i965: Define BRW_MAX_SSBO
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 30 Sep 2015 09:05:49 +0000 (11:05 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 5 Oct 2015 06:12:17 +0000 (08:12 +0200)
Instead of using hard-coded values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h

index 8fcba696c8ed4b9747858320b1f762e2cc9a929e..87c84c6236b4547af28210dff559f668db0371ed 100644 (file)
@@ -582,17 +582,17 @@ brw_initialize_context_constants(struct brw_context *brw)
    /* FIXME: Tessellation stages are not yet supported in i965, so
     * MaxCombinedShaderStorageBlocks doesn't take them into account.
     */
-   ctx->Const.Program[MESA_SHADER_VERTEX].MaxShaderStorageBlocks = 12;
-   ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxShaderStorageBlocks = 12;
+   ctx->Const.Program[MESA_SHADER_VERTEX].MaxShaderStorageBlocks = BRW_MAX_SSBO;
+   ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxShaderStorageBlocks = BRW_MAX_SSBO;
    ctx->Const.Program[MESA_SHADER_TESS_EVAL].MaxShaderStorageBlocks = 0;
    ctx->Const.Program[MESA_SHADER_TESS_CTRL].MaxShaderStorageBlocks = 0;
-   ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxShaderStorageBlocks = 12;
-   ctx->Const.Program[MESA_SHADER_COMPUTE].MaxShaderStorageBlocks = 12;
-   ctx->Const.MaxCombinedShaderStorageBlocks = 12 * 3;
-   ctx->Const.MaxShaderStorageBufferBindings = 36;
+   ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxShaderStorageBlocks = BRW_MAX_SSBO;
+   ctx->Const.Program[MESA_SHADER_COMPUTE].MaxShaderStorageBlocks = BRW_MAX_SSBO;
+   ctx->Const.MaxCombinedShaderStorageBlocks = BRW_MAX_SSBO * 3;
+   ctx->Const.MaxShaderStorageBufferBindings = BRW_MAX_SSBO * 3;
 
    if (_mesa_extension_override_enables.ARB_compute_shader)
-      ctx->Const.MaxShaderStorageBufferBindings += 12;
+      ctx->Const.MaxShaderStorageBufferBindings += BRW_MAX_SSBO;
 
    if (brw->gen >= 6) {
       ctx->Const.MaxVarying = 32;
index 8fe88d2c85fc3c4a40e3204dcf3f145a2be4db61..0ffc262f289cad108d975ff6ab4898780e765ba7 100644 (file)
@@ -711,6 +711,9 @@ struct brw_vs_prog_data {
 /** Max number of UBOs in a shader */
 #define BRW_MAX_UBO 12
 
+/** Max number of SSBOs in a shader */
+#define BRW_MAX_SSBO 12
+
 /** Max number of atomic counter buffer objects in a shader */
 #define BRW_MAX_ABO 16