summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2015-09-30 09:55:00 +0200
committerIago Toral Quiroga <[email protected]>2015-10-05 08:12:17 +0200
commit440f9348c1fb877910cebca5413c4300b6738428 (patch)
tree450a8b0db56fd4a994227e1df3ddf5ca91f7da1c /src
parent4caa10193f6a88f476807aee56b900b3a02d9a6a (diff)
i965: Define BRW_MAX_UBO
Instead of using hard-coded values. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 4d499295730..8fcba696c8e 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -326,7 +326,7 @@ brw_initialize_context_constants(struct brw_context *brw)
ctx->Const.MaxUniformBlockSize = 65536;
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_program_constants *prog = &ctx->Const.Program[i];
- prog->MaxUniformBlocks = 12;
+ prog->MaxUniformBlocks = BRW_MAX_UBO;
prog->MaxCombinedUniformComponents =
prog->MaxUniformComponents +
ctx->Const.MaxUniformBlockSize / 4 * prog->MaxUniformBlocks;
@@ -346,7 +346,7 @@ brw_initialize_context_constants(struct brw_context *brw)
ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 0;
if (_mesa_extension_override_enables.ARB_compute_shader) {
ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
- ctx->Const.MaxUniformBufferBindings += 12;
+ ctx->Const.MaxUniformBufferBindings += BRW_MAX_UBO;
} else {
ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits = 0;
}
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 19a511710da..8fe88d2c85f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -708,6 +708,9 @@ struct brw_vs_prog_data {
/** Max number of render targets in a shader */
#define BRW_MAX_DRAW_BUFFERS 8
+/** Max number of UBOs in a shader */
+#define BRW_MAX_UBO 12
+
/** Max number of atomic counter buffer objects in a shader */
#define BRW_MAX_ABO 16
@@ -744,7 +747,7 @@ struct brw_vs_prog_data {
#define BRW_MAX_SURFACES (BRW_MAX_DRAW_BUFFERS + \
BRW_MAX_TEX_UNIT * 2 + /* normal, gather */ \
- 12 + /* ubo */ \
+ BRW_MAX_UBO + \
BRW_MAX_ABO + \
BRW_MAX_IMAGES + \
2 + /* shader time, pull constants */ \