[Mesa-dev] [PATCH] Add cap for sqrt in virgl tgsi shaders

Joe M. Kniss djmk at chromium.org
Thu Apr 12 16:49:14 UTC 2018


Allow sqrt representation in virgl's use of tgsi rather than
1/invsqrt, which can lead to a nan result when the operand is
0.

Tested: chromeos on qemu + virglrenderer.
Signed-off-by: Joe M. Kniss <djmk at google.com>
---
 src/gallium/drivers/virgl/virgl_screen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 02613f1866..07d0d9fb4d 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -314,6 +314,7 @@ virgl_get_shader_param(struct pipe_screen *screen,
       case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
       case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
       case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
+      case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
          return 1;
       case PIPE_SHADER_CAP_MAX_INPUTS:
          if (vscreen->caps.caps.v1.glsl_level < 150)
-- 
2.17.0.484.g0c8726318c-goog



More information about the mesa-dev mailing list