summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar bunnei2019-01-07 14:22:30 -0500
committerGravatar GitHub2019-01-07 14:22:30 -0500
commit23ebd4920e851a91bba0f2da70b7f63ee6b49dc3 (patch)
tree6b85aee5889aca55284c3b03b2ae9b72522532a1 /src/video_core/engines
parentMerge pull request #1989 from lioncash/set (diff)
parentgl_shader_cache: Use dirty flags for shaders (diff)
downloadyuzu-23ebd4920e851a91bba0f2da70b7f63ee6b49dc3.tar.gz
yuzu-23ebd4920e851a91bba0f2da70b7f63ee6b49dc3.tar.xz
yuzu-23ebd4920e851a91bba0f2da70b7f63ee6b49dc3.zip
Merge pull request #1999 from ReinUsesLisp/dirty-shader
gl_shader_cache: Use dirty flags for shaders
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp8
-rw-r--r--src/video_core/engines/maxwell_3d.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index b19b3a75a..0ed7bc5d8 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -135,6 +135,14 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) {
135 135
136 if (regs.reg_array[method_call.method] != method_call.argument) { 136 if (regs.reg_array[method_call.method] != method_call.argument) {
137 regs.reg_array[method_call.method] = method_call.argument; 137 regs.reg_array[method_call.method] = method_call.argument;
138 // Shader
139 constexpr u32 shader_registers_count =
140 sizeof(regs.shader_config[0]) * Regs::MaxShaderProgram / sizeof(u32);
141 if (method_call.method >= MAXWELL3D_REG_INDEX(shader_config[0]) &&
142 method_call.method < MAXWELL3D_REG_INDEX(shader_config[0]) + shader_registers_count) {
143 dirty_flags.shaders = true;
144 }
145
138 // Vertex format 146 // Vertex format
139 if (method_call.method >= MAXWELL3D_REG_INDEX(vertex_attrib_format) && 147 if (method_call.method >= MAXWELL3D_REG_INDEX(vertex_attrib_format) &&
140 method_call.method < 148 method_call.method <
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 0faff6fdf..d50e5a126 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1089,10 +1089,13 @@ public:
1089 MemoryManager& memory_manager; 1089 MemoryManager& memory_manager;
1090 1090
1091 struct DirtyFlags { 1091 struct DirtyFlags {
1092 bool shaders = true;
1093
1092 bool vertex_attrib_format = true; 1094 bool vertex_attrib_format = true;
1093 u32 vertex_array = 0xFFFFFFFF; 1095 u32 vertex_array = 0xFFFFFFFF;
1094 1096
1095 void OnMemoryWrite() { 1097 void OnMemoryWrite() {
1098 shaders = true;
1096 vertex_array = 0xFFFFFFFF; 1099 vertex_array = 0xFFFFFFFF;
1097 } 1100 }
1098 }; 1101 };