mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 07:05:40 +12:00
[GPU] Fix triangle demo
This commit is contained in:
parent
8b85255f4c
commit
bef634114d
1 changed files with 2 additions and 3 deletions
|
@ -16,7 +16,7 @@ const char* vertexShader = R"(
|
||||||
out vec4 colour;
|
out vec4 colour;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = coords;
|
gl_Position = coords * vec4(1.0, 1.0, -1.0, 1.0);
|
||||||
colour = vertexColour;
|
colour = vertexColour;
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
@ -31,7 +31,6 @@ const char* fragmentShader = R"(
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
fragColour = colour;
|
fragColour = colour;
|
||||||
gl_FragDepth *= -1.0;
|
|
||||||
|
|
||||||
if ((u_alphaControl & 1u) != 0u) { // Check if alpha test is on
|
if ((u_alphaControl & 1u) != 0u) { // Check if alpha test is on
|
||||||
uint func = (u_alphaControl >> 4u) & 7u;
|
uint func = (u_alphaControl >> 4u) & 7u;
|
||||||
|
@ -193,7 +192,7 @@ void GPU::drawVertices(OpenGL::Primitives primType, Vertex* vertices, u32 count)
|
||||||
printf("Depth enable: %d, func: %d, writeEnable: %d\n", depthEnable, depthFunc, depthWriteEnable);
|
printf("Depth enable: %d, func: %d, writeEnable: %d\n", depthEnable, depthFunc, depthWriteEnable);
|
||||||
|
|
||||||
if (depthScale.toFloat32() != -1.0 || depthOffset.toFloat32() != 0.0)
|
if (depthScale.toFloat32() != -1.0 || depthOffset.toFloat32() != 0.0)
|
||||||
Helpers::panic("TODO: Implement depth scale/offset. Remove the depth *= -1.0 from fragment shader");
|
Helpers::panic("TODO: Implement depth scale/offset. Remove the depth *= -1.0 from vertex shader");
|
||||||
|
|
||||||
// TODO: Actually use this
|
// TODO: Actually use this
|
||||||
float viewportWidth = f24::fromRaw(regs[PICAInternalRegs::ViewportWidth] & 0xffffff).toFloat32() * 2.0;
|
float viewportWidth = f24::fromRaw(regs[PICAInternalRegs::ViewportWidth] & 0xffffff).toFloat32() * 2.0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue