nir/spirv/cfg: Handle discard
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Dec 2015 03:23:25 +0000 (19:23 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Dec 2015 03:23:25 +0000 (19:23 -0800)
src/glsl/nir/spirv/vtn_cfg.c

index 03d2c43018dffe90770ad261a562c57d9c2bafa3..eddaa8c46721b22711b372be0d787119ded9b36e 100644 (file)
@@ -470,6 +470,12 @@ vtn_emit_branch(struct vtn_builder *b, enum vtn_branch_type branch_type,
    case vtn_branch_type_return:
       nir_jump(&b->nb, nir_jump_return);
       break;
+   case vtn_branch_type_discard: {
+      nir_intrinsic_instr *discard =
+         nir_intrinsic_instr_create(b->nb.shader, nir_intrinsic_discard);
+      nir_builder_instr_insert(&b->nb, &discard->instr);
+      break;
+   }
    default:
       unreachable("Invalid branch type");
    }