aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2023-12-20 18:45:20 +0100
committerGitHub <noreply@github.com>2023-12-20 18:45:20 +0100
commit9e5b4052edddba9655be7293fe147619ccc86436 (patch)
tree26454a8e0b4e00e6c5a087ca23dac2674f486e49 /src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
parent234867b84deb52073d4509084d0d7f6ee44a9b23 (diff)
parentfcfa8b680b6aedd4b51757d4e33e97ef2cdae048 (diff)
Merge pull request #12403 from liamwhite/clipdistance
shader_recompiler: use minimal clip distance array
Diffstat (limited to 'src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
index 70292686f..cb82a326c 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -913,7 +913,11 @@ void GatherInfoFromHeader(Environment& env, Info& info) {
}
for (size_t index = 0; index < 8; ++index) {
const u16 mask{header.vtg.omap_systemc.clip_distances};
- info.stores.Set(IR::Attribute::ClipDistance0 + index, ((mask >> index) & 1) != 0);
+ const bool used{((mask >> index) & 1) != 0};
+ info.stores.Set(IR::Attribute::ClipDistance0 + index, used);
+ if (used) {
+ info.used_clip_distances = static_cast<u32>(index) + 1;
+ }
}
info.stores.Set(IR::Attribute::PrimitiveId,
header.vtg.omap_systemb.primitive_array_id != 0);