[1/3] radv: scan if shaders use discard (or kill) instructions

Submitted by Samuel Pitoiset on May 10, 2018, 9:43 a.m.

Details

Message ID 20180510094305.22864-1-samuel.pitoiset@gmail.com
State Rejected
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset May 10, 2018, 9:43 a.m.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_shader.h      | 1 +
 src/amd/vulkan/radv_shader_info.c | 4 ++++
 2 files changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index 6588b78772..c28407352a 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -159,6 +159,7 @@  struct radv_shader_info {
 		bool has_pcoord;
 		bool prim_id_input;
 		bool layer_input;
+		bool uses_kill;
 	} ps;
 	struct {
 		bool uses_grid_size;
diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c
index 1fb350faed..4e6dbea5ac 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -246,6 +246,10 @@  gather_intrinsic_info(const nir_shader *nir, const nir_intrinsic_instr *instr,
 		}
 		break;
 	}
+	case nir_intrinsic_discard:
+	case nir_intrinsic_discard_if:
+		info->ps.uses_kill = true;
+		break;
 	default:
 		break;
 	}