summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-31 15:01:50 +0100
committerGravatar Tony Wasserka2014-12-31 16:32:55 +0100
commit323a56f89835714f0973cf808b7b59b2589012d8 (patch)
treea0e02a95d426d34052ff88791bda2986705f0fc9 /src
parentPica/CommandProcessor: Workaround games not setting the input position's w co... (diff)
downloadyuzu-323a56f89835714f0973cf808b7b59b2589012d8.tar.gz
yuzu-323a56f89835714f0973cf808b7b59b2589012d8.tar.xz
yuzu-323a56f89835714f0973cf808b7b59b2589012d8.zip
Pica/CommandProcessor: Cleanups.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/command_processor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 76acdc177..0d9f4ba66 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -114,7 +114,8 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
114 114
115 // Load a debugging token to check whether this gets loaded by the running 115 // Load a debugging token to check whether this gets loaded by the running
116 // application or not. 116 // application or not.
117 input.attr[0].w = float24::FromRawFloat24(0x00abcdef); 117 static const float24 debug_token = float24::FromRawFloat24(0x00abcdef);
118 input.attr[0].w = debug_token;
118 119
119 for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) { 120 for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) {
120 for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { 121 for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
@@ -147,7 +148,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
147 // To do this, we additionally have to assume that the first input attribute 148 // To do this, we additionally have to assume that the first input attribute
148 // is the vertex position, since there's no information about this other than 149 // is the vertex position, since there's no information about this other than
149 // the empiric observation that this is usually the case. 150 // the empiric observation that this is usually the case.
150 if (input.attr[0].w == float24::FromRawFloat24(0x00abcdef)) 151 if (input.attr[0].w == debug_token)
151 input.attr[0].w = float24::FromFloat32(1.0); 152 input.attr[0].w = float24::FromFloat32(1.0);
152 153
153 if (g_debug_context) 154 if (g_debug_context)
@@ -195,7 +196,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
195 int index = (id - PICA_REG_INDEX_WORKAROUND(vs_int_uniforms[0], 0x2b1)); 196 int index = (id - PICA_REG_INDEX_WORKAROUND(vs_int_uniforms[0], 0x2b1));
196 auto values = registers.vs_int_uniforms[index]; 197 auto values = registers.vs_int_uniforms[index];
197 VertexShader::GetIntUniform(index) = Math::Vec4<u8>(values.x, values.y, values.z, values.w); 198 VertexShader::GetIntUniform(index) = Math::Vec4<u8>(values.x, values.y, values.z, values.w);
198 LOG_ERROR(HW_GPU, "Set integer uniform %d to %02x %02x %02x %02x", 199 LOG_TRACE(HW_GPU, "Set integer uniform %d to %02x %02x %02x %02x",
199 index, values.x.Value(), values.y.Value(), values.z.Value(), values.w.Value()); 200 index, values.x.Value(), values.y.Value(), values.z.Value(), values.w.Value());
200 break; 201 break;
201 } 202 }