diff options
author | Iago Toral Quiroga <[email protected]> | 2015-09-30 11:05:49 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2015-10-05 08:12:17 +0200 |
commit | 41c4d45e08b3bf948f24d007c9b7d0c47f3f89d8 (patch) | |
tree | c5836f5ec3d135c951f3ebb94158d27819abfdaa | |
parent | 440f9348c1fb877910cebca5413c4300b6738428 (diff) |
i965: Define BRW_MAX_SSBO
Instead of using hard-coded values.
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 3 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 8fcba696c8e..87c84c6236b 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -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; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 8fe88d2c85f..0ffc262f289 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -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 |