spirv: add support for SPV_KHR_post_depth_coverage
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 20 Jul 2018 21:50:01 +0000 (15:50 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sun, 22 Jul 2018 21:56:36 +0000 (14:56 -0700)
Allow the capability to be exposed, and convert the new execution mode
into fs state.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/shader_info.h
src/compiler/spirv/spirv_to_nir.c

index 3b95d5962c07ffe961519f9a6cd3fdc74f4ef75b..e9ca222dea860ffa091657fe8d30e57a37cbc4b9 100644 (file)
@@ -59,6 +59,7 @@ struct spirv_supported_capabilities {
    bool stencil_export;
    bool atomic_storage;
    bool storage_8bit;
+   bool post_depth_coverage;
 };
 
 typedef struct shader_info {
index bbef3fcf4dffbbf421d2d3e43ae8e93b27295fcc..79104695f5f4b9804e7b5f7424d548c93c99b679 100644 (file)
@@ -3542,6 +3542,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          spv_check_supported(stencil_export, cap);
          break;
 
+      case SpvCapabilitySampleMaskPostDepthCoverage:
+         spv_check_supported(post_depth_coverage, cap);
+         break;
+
       default:
          vtn_fail("Unhandled capability");
       }
@@ -3609,6 +3613,11 @@ vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point,
       b->shader->info.fs.early_fragment_tests = true;
       break;
 
+   case SpvExecutionModePostDepthCoverage:
+      vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT);
+      b->shader->info.fs.post_depth_coverage = true;
+      break;
+
    case SpvExecutionModeInvocations:
       vtn_assert(b->shader->info.stage == MESA_SHADER_GEOMETRY);
       b->shader->info.gs.invocations = MAX2(1, mode->literals[0]);