From 8a67fd3c68cd11b92d2a2241a997490a4b598aa9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 3 Aug 2017 14:16:27 +1000 Subject: [PATCH] virgl: diverge tgsi_instruction from upstream. We can't drop instructions in virgl, we need to keep parsing them, so we should just add new ones at the end. --- src/gallium/auxiliary/tgsi/tgsi_build.c | 3 ++- src/gallium/include/pipe/p_shader_tokens.h | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index b237df4..e243c46 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -615,7 +615,8 @@ tgsi_default_instruction( void ) instruction.NumSrcRegs = 1; instruction.Label = 0; instruction.Texture = 0; - instruction.Padding = 0; + instruction.Memory = 0; + instruction.Precise = 0; return instruction; } diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index cff2a73..c778e70 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -302,6 +302,10 @@ struct tgsi_property_data { * which APIs are known to use which opcodes, see * gallium/docs/source/tgsi.rst */ +/* VIRGLRENDERER specific - DON'T SYNC WITH MESA + * OR REMOVE OPCODES - FILL in and REWRITE tgsi_info + * accordingly. + */ #define TGSI_OPCODE_ARL 0 #define TGSI_OPCODE_MOV 1 #define TGSI_OPCODE_LIT 2 @@ -554,17 +558,23 @@ struct tgsi_property_data { * Saturate controls how are final results in destination registers modified. */ +/* + * VIRGLRENDERER specific - + * we no long keep this in sync with mesa, we had to increase the NrTokens + * as mesa can remove old opcodes, but the renderer cannot. + */ struct tgsi_instruction { unsigned Type : 4; /* TGSI_TOKEN_TYPE_INSTRUCTION */ - unsigned NrTokens : 8; /* UINT */ + unsigned NrTokens : 9; /* UINT */ unsigned Opcode : 8; /* TGSI_OPCODE_ */ unsigned Saturate : 1; /* BOOL */ unsigned NumDstRegs : 2; /* UINT */ unsigned NumSrcRegs : 4; /* UINT */ unsigned Label : 1; unsigned Texture : 1; - unsigned Padding : 3; + unsigned Memory : 1; + unsigned Precise : 1; }; /*