summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-12-12 12:24:18 -0800
committerIan Romanick <[email protected]>2016-12-19 15:55:37 -0800
commitd56bd07bb3b6821eca961dde15c40f179be99e2d (patch)
tree92f05fa09c4ad4d0a8f7f5c862fb842f7584f9e9 /src/mesa
parent300de78ab17433ea05f39013c9eede6a851bcb24 (diff)
glsl: Track the linearized array index for each UBO instance array element
v2: Set linearizer_array_index in process_block_array_leaf. Suggested by Timothy. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 36d48e2115d..ac4cac0e498 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2493,6 +2493,21 @@ struct gl_uniform_block
uint8_t stageref;
/**
+ * Linearized array index for uniform block instance arrays
+ *
+ * Given a uniform block instance array declared with size
+ * blk[s_0][s_1]..[s_m], the block referenced by blk[i_0][i_1]..[i_m] will
+ * have the linearized array index
+ *
+ * m-1 m
+ * i_m + ∑ i_j * ∏ s_k
+ * j=0 k=j+1
+ *
+ * For a uniform block instance that is not an array, this is always 0.
+ */
+ uint8_t linearized_array_index;
+
+ /**
* Layout specified in the shader
*
* This isn't accessible through the API, but it is used while