summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-09-13 15:58:00 +0200
committerSamuel Pitoiset <[email protected]>2018-09-14 10:59:52 +0200
commita006c24237be3019292720dfff93214a3c037b86 (patch)
tree265d634e812e1e69c3b6d36d1e1b16c5d519f147 /src/amd
parent9447e913297008718059714908d7105287804953 (diff)
radv: always compute the number of components from the output mask
That removes two special cases for clip/cull distances. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 116419557be..e3f63ce5f76 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -1725,16 +1725,11 @@ visit_emit_vertex(struct ac_shader_abi *abi, unsigned stream, LLVMValueRef *addr
unsigned output_usage_mask =
ctx->shader_info->info.gs.output_usage_mask[i];
LLVMValueRef *out_ptr = &addrs[i * 4];
- int length = 4;
+ int length = util_last_bit(output_usage_mask);
if (!(ctx->output_mask & (1ull << i)))
continue;
- if (i == VARYING_SLOT_CLIP_DIST0) {
- /* pack clip and cull into a single set of slots */
- length = util_last_bit(output_usage_mask);
- }
-
for (unsigned j = 0; j < length; j++) {
if (!(output_usage_mask & (1 << j)))
continue;
@@ -3591,16 +3586,11 @@ ac_gs_copy_shader_emit(struct radv_shader_context *ctx)
for (unsigned i = 0; i < AC_LLVM_MAX_OUTPUTS; ++i) {
unsigned output_usage_mask =
ctx->shader_info->info.gs.output_usage_mask[i];
- int length = 4;
+ int length = util_last_bit(output_usage_mask);
if (!(ctx->output_mask & (1ull << i)))
continue;
- if (i == VARYING_SLOT_CLIP_DIST0) {
- /* unpack clip and cull from a single set of slots */
- length = util_last_bit(output_usage_mask);
- }
-
for (unsigned j = 0; j < length; j++) {
LLVMValueRef value, soffset;