summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2014-09-23 11:56:54 -0700
committerAnuj Phogat <[email protected]>2014-10-01 12:04:15 -0700
commit38cd40faab8686023ac48e323014f951abf47098 (patch)
tree20f5f675528c8d1c87045ffcf5a8cd9b6fb04e77 /src/mesa/main
parent4f7916ab4f8093fa33519dfa3d08e73b4d35ebe3 (diff)
mesa: Add new variables in gl_context to store sample layout
SampleMap{2,4,8}x variables are used in later patches to implement EXT_framebuffer_multisample_blit_scaled extension. V2: Use integer array instead of a string. Bump up the comment. V3: Use uint8_t type array. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index dd330eab729..5e9453b2fd7 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3606,6 +3606,38 @@ struct gl_constants
GLint MaxDepthTextureSamples;
GLint MaxIntegerSamples;
+ /**
+ * GL_EXT_texture_multisample_blit_scaled implementation assumes that
+ * samples are laid out in a rectangular grid roughly corresponding to
+ * sample locations within a pixel. Below SampleMap{2,4,8}x variables
+ * are used to map indices of rectangular grid to sample numbers within
+ * a pixel. This mapping of indices to sample numbers must be initialized
+ * by the driver for the target hardware. For example, if we have the 8X
+ * MSAA sample number layout (sample positions) for XYZ hardware:
+ *
+ * sample indices layout sample number layout
+ * --------- ---------
+ * | 0 | 1 | | a | b |
+ * --------- ---------
+ * | 2 | 3 | | c | d |
+ * --------- ---------
+ * | 4 | 5 | | e | f |
+ * --------- ---------
+ * | 6 | 7 | | g | h |
+ * --------- ---------
+ *
+ * Where a,b,c,d,e,f,g,h are integers between [0-7].
+ *
+ * Then, initialize the SampleMap8x variable for XYZ hardware as shown
+ * below:
+ * SampleMap8x = {a, b, c, d, e, f, g, h};
+ *
+ * Follow the logic for other sample counts.
+ */
+ uint8_t SampleMap2x[2];
+ uint8_t SampleMap4x[4];
+ uint8_t SampleMap8x[8];
+
/** GL_ARB_shader_atomic_counters */
GLuint MaxAtomicBufferBindings;
GLuint MaxAtomicBufferSize;