summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-04-05 04:03:12 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:26 +0200
commitdcaf0e91508562a70a49db7011ad09f13f811d71 (patch)
tree9d3f48adc0a94c6a8b411a8e98c0e7a2d06b1d81 /src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
parentshader: Implement indexed Position and ClipDistances (diff)
downloadyuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.tar
yuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.tar.gz
yuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.tar.bz2
yuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.tar.lz
yuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.tar.xz
yuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.tar.zst
yuzu-dcaf0e91508562a70a49db7011ad09f13f811d71.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp22
1 files changed, 9 insertions, 13 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 a14465598..1c03ee82a 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -511,37 +511,33 @@ void Visit(Info& info, IR::Inst& inst) {
}
void GatherInfoFromHeader(Environment& env, Info& info) {
- auto stage = env.ShaderStage();
+ Stage stage{env.ShaderStage()};
if (stage == Stage::Compute) {
return;
}
- const auto& header = env.SPH();
+ const auto& header{env.SPH()};
if (stage == Stage::Fragment) {
if (!info.loads_indexed_attributes) {
return;
}
for (size_t i = 0; i < info.input_generics.size(); i++) {
- info.input_generics[i].used =
- info.input_generics[i].used || header.ps.IsGenericVectorActive(i);
+ info.input_generics[i].used |= header.ps.IsGenericVectorActive(i);
}
- info.loads_position = info.loads_position || header.ps.imap_systemb.position != 0;
+ info.loads_position |= header.ps.imap_systemb.position != 0;
return;
}
if (info.loads_indexed_attributes) {
for (size_t i = 0; i < info.input_generics.size(); i++) {
- info.input_generics[i].used =
- info.input_generics[i].used || header.vtg.IsInputGenericVectorActive(i);
+ info.input_generics[i].used |= header.vtg.IsInputGenericVectorActive(i);
}
+ info.loads_position |= header.vtg.imap_systemb.position != 0;
}
if (info.stores_indexed_attributes) {
- info.loads_position = info.loads_position || header.vtg.imap_systemb.position != 0;
for (size_t i = 0; i < info.stores_generics.size(); i++) {
- info.stores_generics[i] =
- info.stores_generics[i] || header.vtg.IsOutputGenericVectorActive(i);
+ info.stores_generics[i] |= header.vtg.IsOutputGenericVectorActive(i);
}
- info.stores_clip_distance =
- info.stores_clip_distance || header.vtg.omap_systemc.clip_distances != 0;
- info.stores_position = info.stores_position || header.vtg.omap_systemb.position != 0;
+ info.stores_clip_distance |= header.vtg.omap_systemc.clip_distances != 0;
+ info.stores_position |= header.vtg.omap_systemb.position != 0;
}
}