[Mesa-dev] [PATCH] glsl/standalone: add missing do_mat_op_to_vec() pass

Rob Clark robdclark at gmail.com
Thu Jan 19 19:50:26 UTC 2017


On Thu, Jan 19, 2017 at 1:48 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On Thursday, January 19, 2017 1:16:18 PM PST Rob Clark wrote:
>> glsl_to_nir expects matrix ops to be lowered away to vector by the time
>> it runs, but standalone wasn't bothering to call this pass.
>>
>> Signed-off-by: Rob Clark <robdclark at gmail.com>
>> ---
>>  src/compiler/glsl/standalone.cpp | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
>> index 9a8d75d..20fe231 100644
>> --- a/src/compiler/glsl/standalone.cpp
>> +++ b/src/compiler/glsl/standalone.cpp
>> @@ -381,6 +381,7 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader)
>>        new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader);
>>
>>     _mesa_glsl_compile_shader(ctx, shader, options->dump_ast, options->dump_hir);
>> +   do_mat_op_to_vec(shader->ir);
>>
>>     /* Print out the resulting IR */
>>     if (!state->error && options->dump_lir) {
>>
>
> The standalone compiler can optionally link shaders.  You don't want to
> lower matrices prior to linking, as that could break varying matching...

hmm, I even had options->do_link true (but I guess that bailed
somewhere since I was only trying to compile a single stage..)

presumably this should be harmless to do multiple times, if I just
called in unconditionally after linking?

BR,
-R


More information about the mesa-dev mailing list