summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-04-04 09:38:15 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:26 +0200
commit73cb17f41bf019df504d2d2af4ebdf45aa3201c6 (patch)
tree97ca7cbbefaae73eb77d6e91bbcac4dbe4238c3a /src/shader_recompiler/ir_opt
parentshader: Implement indexed attributes (diff)
downloadyuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.tar
yuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.tar.gz
yuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.tar.bz2
yuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.tar.lz
yuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.tar.xz
yuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.tar.zst
yuzu-73cb17f41bf019df504d2d2af4ebdf45aa3201c6.zip
Diffstat (limited to 'src/shader_recompiler/ir_opt')
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp26
1 files changed, 18 insertions, 8 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 dbe9f1f40..a14465598 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -517,22 +517,32 @@ void GatherInfoFromHeader(Environment& env, Info& info) {
}
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.loads_position = info.loads_position || header.ps.imap_systemb.position != 0;
return;
}
- 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);
+ 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);
+ }
}
- for (size_t i = 0; i < info.stores_generics.size(); i++) {
- info.stores_generics[i] =
- info.stores_generics[i] || header.vtg.IsOutputGenericVectorActive(i);
+ 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_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 =
- info.stores_clip_distance || header.vtg.omap_systemc.clip_distances != 0;
}
} // Anonymous namespace