summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2014-05-14 21:06:23 +0200
committerRoland Scheidegger <[email protected]>2014-05-15 02:35:25 +0200
commit3e817e7e56806d8adb8f16c35136045c29908944 (patch)
treef8083144a13d3c8b642849f9ade0e468c0daaf17 /src/mesa/state_tracker
parent9c64cb80d29bb779a99f5a32b0974e8f92e8c902 (diff)
mesa/st: fix number of ubos being declared in a shader
Previously the code used the total number of ubos being declared in the linked program (so the ubos of all shaders combined), use the number from the particular shader instead. This fixes an assertion failure with piglit arb_uniform_buffer_object-maxblocks seen in llvmpipe since 8a9f5ecdb116d0449d63f7b94efbfa8b205d826f as it now emits code for each declared buffer, not just the ones actually used. CC: "10.1 10.2" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index f3535c5810d..79d013d028f 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -325,6 +325,7 @@ public:
struct gl_context *ctx;
struct gl_program *prog;
struct gl_shader_program *shader_program;
+ struct gl_shader *shader;
struct gl_shader_compiler_options *options;
int next_temp;
@@ -5096,11 +5097,11 @@ st_translate_program(
}
}
- if (program->shader_program) {
- unsigned num_ubos = program->shader_program->NumUniformBlocks;
+ if (program->shader) {
+ unsigned num_ubos = program->shader->NumUniformBlocks;
for (i = 0; i < num_ubos; i++) {
- ureg_DECL_constant2D(t->ureg, 0, program->shader_program->UniformBlocks[i].UniformBufferSize / 4, i + 1);
+ ureg_DECL_constant2D(t->ureg, 0, program->shader->UniformBlocks[i].UniformBufferSize / 4, i + 1);
}
}
@@ -5221,6 +5222,7 @@ get_mesa_program(struct gl_context *ctx,
v->ctx = ctx;
v->prog = prog;
v->shader_program = shader_program;
+ v->shader = shader;
v->options = options;
v->glsl_version = ctx->Const.GLSLVersion;
v->native_integers = ctx->Const.NativeIntegers;