summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2018-02-07 23:17:08 +0100
committerAlejandro Piñeiro <[email protected]>2018-06-21 14:25:05 +0200
commit7dd96a065317b32e230aa9cb5b6994024705b8c1 (patch)
treea2c2814cc3f1b372e798c3b803f8c30e5c84ac23 /src
parent4bf8b80f54005d3cf6e435f9be7e4e948531f226 (diff)
i965: Update TexturesUsed after linking the shaders
Otherwise if the shader is SPIR-V then SamplerUsed won’t have been initialised yet so it will end up thinking no textures are used. This was causing a crash later on if nothing causes it to regenerate TexturesUsed before the next render. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 996465f305a..0203c44f1cb 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -246,7 +246,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
_mesa_copy_linked_program_data(shProg, shader);
prog->ShadowSamplers = shader->shadow_samplers;
- _mesa_update_shader_textures_used(shProg, prog);
bool debug_enabled =
(INTEL_DEBUG & intel_debug_flag_for_shader_stage(shader->Stage));
@@ -300,6 +299,9 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
continue;
struct gl_program *prog = shader->Program;
+
+ _mesa_update_shader_textures_used(shProg, prog);
+
brw_shader_gather_info(prog->nir, prog);
NIR_PASS_V(prog->nir, gl_nir_lower_samplers, shProg);