diff options
author | Alejandro Piñeiro <[email protected]> | 2018-09-05 12:39:35 +0200 |
---|---|---|
committer | Alejandro Piñeiro <[email protected]> | 2018-09-05 17:02:28 +0200 |
commit | 8969777686307c5649916d0e2d1024ae1e1af1ce (patch) | |
tree | b39057f38c22514fae950740f754cddad419be09 | |
parent | 2a6182fe06731b09d89cdd819e887606d683ed2f (diff) |
i965: move brw_nir_lower_gl_images call
At this moment that lowering is using info coming from the
UniformStorage, so for the ARB_gl_spirv codepath, it needs to be done
after calling gl_nir_link_uniforms. As for the GLSL codepath it can
also be called later, we just move the call on both cases, to avoid
adding several shader->spirv_data checks, and keep the patch as small
as possible.
This is the first patch needed to fix the following piglit tests:
tests/spec/arb_gl_spirv/linker/uniform/multisampler.shader_test
tests/spec/arb_gl_spirv/linker/uniform/multisampler-array.shader_test
but fixes thousands of tests when borrowing the tests from other specs
(that needs to be done manually right now).
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_link.cpp | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.c | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 0723255dec6..2cbb1e0b879 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -270,6 +270,16 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) gl_nir_link_assign_xfb_resources(ctx, shProg); } + for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) { + struct gl_linked_shader *shader = shProg->_LinkedShaders[stage]; + if (!shader) + continue; + + struct gl_program *prog = shader->Program; + + NIR_PASS_V(prog->nir, brw_nir_lower_gl_images, prog); + } + /* Determine first and last stage. */ unsigned first = MESA_SHADER_STAGES; unsigned last = 0; diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index ba418e45b85..f5ebd3c3b05 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -140,7 +140,6 @@ brw_create_nir(struct brw_context *brw, } NIR_PASS_V(nir, brw_nir_lower_uniforms, is_scalar); - NIR_PASS_V(nir, brw_nir_lower_gl_images, prog); return nir; } |