summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-02-14 13:50:00 -0700
committerBrian Paul <[email protected]>2018-02-15 09:05:01 -0700
commit6f0aec5671a1efd374f517d3f9e4b0ff1c4c4709 (patch)
tree5367fde9964a5a87ad64e46908de163ccaa24fab /src/gallium/drivers/svga
parent579b33c1fd6962fb85e6cec23035df3ba826cc50 (diff)
svga: call tgsi_scan_shader() for dummy shaders
If we fail to compile the normal VS or FS we fall back to a simple/ dummy shader. We need to rescan the the shader to update the shader info. Otherwise, this can lead to further translations failures because the shader info doesn't match the actual shader. Found by adding some extra debug assertions in the state-update code while debugging something else. v2: also update shader generic_inputs/outputs, etc. per Charmaine Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_state_fs.c4
-rw-r--r--src/gallium/drivers/svga/svga_state_vs.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c
index 5e568993fed..eeb1ba60f65 100644
--- a/src/gallium/drivers/svga/svga_state_fs.c
+++ b/src/gallium/drivers/svga/svga_state_fs.c
@@ -115,6 +115,10 @@ get_compiled_dummy_shader(struct svga_context *svga,
FREE((void *) fs->base.tokens);
fs->base.tokens = dummy;
+ tgsi_scan_shader(fs->base.tokens, &fs->base.info);
+ fs->generic_inputs = svga_get_generic_inputs_mask(&fs->base.info);
+ svga_remap_generics(fs->generic_inputs, fs->generic_remap_table);
+
variant = translate_fragment_program(svga, fs, key);
return variant;
}
diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c
index a0ab868cbba..3dfc9f451c9 100644
--- a/src/gallium/drivers/svga/svga_state_vs.c
+++ b/src/gallium/drivers/svga/svga_state_vs.c
@@ -105,6 +105,9 @@ get_compiled_dummy_vertex_shader(struct svga_context *svga,
FREE((void *) vs->base.tokens);
vs->base.tokens = dummy;
+ tgsi_scan_shader(vs->base.tokens, &vs->base.info);
+ vs->generic_outputs = svga_get_generic_outputs_mask(&vs->base.info);
+
variant = translate_vertex_program(svga, vs, key);
return variant;
}