[Mesa-dev] [PATCH 1/3] svga: call tgsi_scan_shader() for dummy shaders
Brian Paul
brianp at vmware.com
Wed Feb 14 21:15:12 UTC 2018
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.
---
src/gallium/drivers/svga/svga_state_fs.c | 2 ++
src/gallium/drivers/svga/svga_state_vs.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c
index 5e56899..f185a68 100644
--- a/src/gallium/drivers/svga/svga_state_fs.c
+++ b/src/gallium/drivers/svga/svga_state_fs.c
@@ -115,6 +115,8 @@ 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);
+
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 a0ab868..1dcc161 100644
--- a/src/gallium/drivers/svga/svga_state_vs.c
+++ b/src/gallium/drivers/svga/svga_state_vs.c
@@ -105,6 +105,8 @@ 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);
+
variant = translate_vertex_program(svga, vs, key);
return variant;
}
--
2.7.4
More information about the mesa-dev
mailing list