svga: abort shader translation upon indirect indexing of temporaries
authorCharmaine Lee <charmainel@vmware.com>
Wed, 2 Aug 2017 01:02:57 +0000 (18:02 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 8 Sep 2017 19:58:38 +0000 (13:58 -0600)
This patch aborts shader translation upon indirect indexing of temporary
register on non-vgpu10 device. This prevents non-supported feature
sending to the device.

Tested wth MTT-piglit, glretrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_tgsi.c

index 7cbd5166900e70fbe5911b1f42b70688ae72a1e3..0b2d8af64d99fd73daa54bfb51d9e3caadc05562 100644 (file)
@@ -209,6 +209,12 @@ svga_tgsi_vgpu9_translate(struct svga_context *svga,
       goto fail;
    }
 
+   if (emit.info.indirect_files & (1 << TGSI_FILE_TEMPORARY)) {
+      debug_printf(
+         "svga: indirect indexing of temporary registers is not supported.\n");
+      goto fail;
+   }
+
    emit.in_main_func = TRUE;
 
    if (!svga_shader_emit_header(&emit)) {