OSDN Git Service

virgl: Enable CAP_CLIP_HALFZ if host supports it
authorGert Wollny <gert.wollny@collabora.com>
Tue, 7 May 2019 17:50:46 +0000 (19:50 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Thu, 6 Jun 2019 10:24:53 +0000 (12:24 +0200)
On according hosts this enables the piglits as "pass":
  arb_clip_control-*

v2: sync flag with host

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/drivers/virgl/virgl_hw.h
src/gallium/drivers/virgl/virgl_screen.c

index bc6803f..a01c48d 100644 (file)
@@ -242,6 +242,7 @@ enum virgl_formats {
 #define VIRGL_CAP_INDIRECT_PARAMS      (1 << 22)
 #define VIRGL_CAP_TRANSFORM_FEEDBACK3  (1 << 23)
 #define VIRGL_CAP_INDIRECT_INPUT_ADDR  (1 << 25)
+#define VIRGL_CAP_CLIP_HALFZ           (1 << 27)
 
 
 /* virgl bind flags - these are compatible with mesa 10.5 gallium.
index 2880aa3..29f1b5b 100644 (file)
@@ -280,7 +280,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
-   case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_VERTEXID_NOBASE:
    case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
@@ -341,6 +340,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
    case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
       return 0;
+   case PIPE_CAP_CLIP_HALFZ:
+      return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_CLIP_HALFZ;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
    case PIPE_CAP_MAX_SHADER_BUFFER_SIZE: