mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-17 11:11:30 +12:00
[GPU] Output mangenta when an unimplemented TEV source is used
This commit is contained in:
parent
2e85f30c10
commit
bcf6401d4d
1 changed files with 7 additions and 3 deletions
|
@ -61,6 +61,8 @@ const char* fragmentShader = R"(
|
||||||
vec4 buffer;
|
vec4 buffer;
|
||||||
vec4 next_buffer;
|
vec4 next_buffer;
|
||||||
|
|
||||||
|
bool tev_unimplemented_source = false;
|
||||||
|
|
||||||
vec4 tev_evaluate_source(int tev_id, int src_id) {
|
vec4 tev_evaluate_source(int tev_id, int src_id) {
|
||||||
vec4 source = vec4(1.0);
|
vec4 source = vec4(1.0);
|
||||||
|
|
||||||
|
@ -75,7 +77,7 @@ const char* fragmentShader = R"(
|
||||||
case 13u: source.rgb = buffer.rgb; break; // Previous buffer
|
case 13u: source.rgb = buffer.rgb; break; // Previous buffer
|
||||||
case 14u: source.rgb = u_textureEnvColor[tev_id].rgb; break; // Constant (GPUREG_TEXENVi_COLOR)
|
case 14u: source.rgb = u_textureEnvColor[tev_id].rgb; break; // Constant (GPUREG_TEXENVi_COLOR)
|
||||||
case 15u: source.rgb = previous.rgb; break; // Previous (output from TEV #n-1)
|
case 15u: source.rgb = previous.rgb; break; // Previous (output from TEV #n-1)
|
||||||
default: return vec4(0.0, 1.0, 1.0, 1.0); break; // TODO: implement remaining sources
|
default: tev_unimplemented_source = true; break; // TODO: implement remaining sources
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (alpha_source) {
|
switch (alpha_source) {
|
||||||
|
@ -84,7 +86,7 @@ const char* fragmentShader = R"(
|
||||||
case 13u: source.a = buffer.a; break; // Previous buffer
|
case 13u: source.a = buffer.a; break; // Previous buffer
|
||||||
case 14u: source.a = u_textureEnvColor[tev_id].a; break; // Constant (GPUREG_TEXENVi_COLOR)
|
case 14u: source.a = u_textureEnvColor[tev_id].a; break; // Constant (GPUREG_TEXENVi_COLOR)
|
||||||
case 15u: source.a = previous.a; break; // Previous (output from TEV #n-1)
|
case 15u: source.a = previous.a; break; // Previous (output from TEV #n-1)
|
||||||
default: return vec4(0.0, 1.0, 1.0, 1.0); break; // TODO: implement remaining sources
|
default: tev_unimplemented_source = true; break; // TODO: implement remaining sources
|
||||||
}
|
}
|
||||||
|
|
||||||
uint rgb_operand = (u_textureEnvOperand[tev_id] >> (src_id * 4)) & 15u;
|
uint rgb_operand = (u_textureEnvOperand[tev_id] >> (src_id * 4)) & 15u;
|
||||||
|
@ -195,7 +197,9 @@ const char* fragmentShader = R"(
|
||||||
|
|
||||||
fragColour = tev_combine(5);
|
fragColour = tev_combine(5);
|
||||||
|
|
||||||
if((u_textureEnvUpdateBuffer & 0xFF00u) != 0u) {fragColour = vec4(1.0, 0.5, 1.0, 1.0); return; }
|
if (tev_unimplemented_source) {
|
||||||
|
fragColour = vec4(1.0, 0.0, 1.0, 1.0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fragColour = colour;
|
fragColour = colour;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue