[Mesa-dev] [PATCH 2/2] glsl: Add a pass to flip matrix/vector multiplies to use dot products.

Kenneth Graunke kenneth at whitecape.org
Thu Apr 4 12:13:12 PDT 2013


On 04/04/2013 08:13 AM, Paul Berry wrote:
> On 2 April 2013 23:33, Kenneth Graunke <kenneth at whitecape.org> wrote:
[snip]
>     diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
>     index ce084b4..13dfdd3 100644
>     --- a/src/glsl/main.cpp
>     +++ b/src/glsl/main.cpp
>     @@ -176,7 +176,7 @@ compile_shader(struct gl_context *ctx, struct
>     gl_shader *shader)
>          if (!state->error && !shader->ir->is_empty()) {
>             bool progress;
>             do {
>     -        progress = do_common_optimization(shader->ir, false, false,
>     32);
>     +        progress = do_common_optimization(shader->ir, false, false,
>     32, false);
>
>
> What's the reason for passing false in this case?  It seems like we
> ought to pass ctx->mvp_with_dp4 in all cases.

Fair enough.  For the standalone compiler, I just picked something 
rather arbitrarily.  ctx->mvp_with_dp4 is false for now.

> For that matter, I'm curious why we don't just check the value of
> ctx->mvp_with_dp4 from inside do_common_optimization()--it seems like
> that would be easier to maintain.

It doesn't currently have access to gl_context.  I could instead pass 
that...or move this flag inside ctx->ShaderCompilerOptions and pass a 
const pointer to that instead.  Preferences?

> With that question addressed, this series is:
>
> Reviewed-by: Paul Berry <stereotype441 at gmail.com>

Thanks Paul!


More information about the mesa-dev mailing list