summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_context.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-11-03 17:40:56 -0600
committerBrian Paul <brianp@vmware.com>2011-11-03 17:41:08 -0600
commit58ea42b7db72586563914dea6fed9656caaf7678 (patch)
tree3e04b2337d23bba8ad120e0d99cef0e2a1893901 /src/gallium/drivers/svga/svga_context.h
parente814d577253d3b618cc40e36f9d50b42fe61d6ed (diff)
downloadexternal_mesa3d-58ea42b7db72586563914dea6fed9656caaf7678.zip
external_mesa3d-58ea42b7db72586563914dea6fed9656caaf7678.tar.gz
external_mesa3d-58ea42b7db72586563914dea6fed9656caaf7678.tar.bz2
svga: implement generic variable index remapping
The state tracker may generate shaders that use generic vs outputs / fs inputs like: DCL IN[0], GENERIC[0] DCL IN[1], GENERIC[10] DCL IN[2], GENERIC[11] This patch remaps 0, 10, 11 to small integers like 1, 2, 3 so that we stay inside the SVGA3D limit (8). The remapping is done to both the vertex shader outputs and the fragment shader inputs. The same mapping must be used for a vs/fs pair. Note that 'union svga_compile_key' is now 'struct svga_compile_key' because we needed to add the register remapping table. The change in size isn't really significant though (it's not a search key). Also, add assertions when building up SVGA3D src/dst registers to we don't try to store too large of value for the bitfield size. Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.h')
-rw-r--r--src/gallium/drivers/svga/svga_context.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 47e08ba..86e5f23 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -36,6 +36,7 @@
#include "tgsi/tgsi_scan.h"
#include "svga_state.h"
+#include "svga_tgsi.h"
#include "svga_hw_reg.h"
#include "svga3d_shaderdefs.h"
@@ -66,6 +67,11 @@ struct svga_shader
struct svga_fragment_shader
{
struct svga_shader base;
+
+ /** Mask of which generic varying variables are read by this shader */
+ unsigned generic_inputs;
+ /** Table mapping original TGSI generic indexes to low integers */
+ int8_t generic_remap_table[MAX_GENERIC_VARYING];
};
struct svga_vertex_shader