[Mesa-dev] [PATCH 11/11] glsl: Reject linking shaders with too many uniform blocks.
Eric Anholt
eric at anholt.net
Thu Jul 26 09:17:44 PDT 2012
Brian Paul <brianp at vmware.com> writes:
> On 07/20/2012 04:33 PM, Eric Anholt wrote:
>> Part of fixing piglit maxblocks.
>> ---
>> src/glsl/linker.cpp | 34 ++++++++++++++++++++++++++++++++++
>> 1 file changed, 34 insertions(+)
>>
>> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
>> index bfdde40..f4e578f 100644
>> --- a/src/glsl/linker.cpp
>> +++ b/src/glsl/linker.cpp
>> @@ -2324,6 +2324,12 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
>> 0 /* FINISHME: Geometry shaders. */
>> };
>>
>> + const unsigned max_uniform_blocks[MESA_SHADER_TYPES] = {
>> + ctx->Const.VertexProgram.MaxUniformBlocks,
>> + ctx->Const.FragmentProgram.MaxUniformBlocks,
>> + ctx->Const.GeometryProgram.MaxUniformBlocks,
>> + };
>> +
>> for (unsigned i = 0; i< MESA_SHADER_TYPES; i++) {
>> struct gl_shader *sh = prog->_LinkedShaders[i];
>>
>> @@ -2348,6 +2354,34 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
>> }
>> }
>>
>> + unsigned blocks[] = {0, 0, 0};
>
> Should that be:
> unsigned blocks[MESA_SHADER_TYPES] = { 0, 0, 0 };
I've changed it to just blocks[MESA_SHADER_TYPES] = { 0 } since trailing
entries get zero-filled.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120726/5a9749ef/attachment.pgp>
More information about the mesa-dev
mailing list