mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-09 07:35:41 +12:00
GL: Fix logic op in display
This commit is contained in:
parent
0f973a4ae4
commit
5d1a2625f5
1 changed files with 10 additions and 8 deletions
|
@ -458,6 +458,8 @@ void RendererGL::display() {
|
||||||
gl.disableBlend();
|
gl.disableBlend();
|
||||||
gl.disableDepth();
|
gl.disableDepth();
|
||||||
gl.disableScissor();
|
gl.disableScissor();
|
||||||
|
// This will work fine whether or not logic ops are enabled. We set logic op to copy instead of disabling to avoid state changes
|
||||||
|
gl.setLogicOp(GL_COPY);
|
||||||
gl.setColourMask(true, true, true, true);
|
gl.setColourMask(true, true, true, true);
|
||||||
gl.useProgram(displayProgram);
|
gl.useProgram(displayProgram);
|
||||||
gl.bindVAO(dummyVAO);
|
gl.bindVAO(dummyVAO);
|
||||||
|
@ -465,18 +467,14 @@ void RendererGL::display() {
|
||||||
gl.disableClipPlane(0);
|
gl.disableClipPlane(0);
|
||||||
gl.disableClipPlane(1);
|
gl.disableClipPlane(1);
|
||||||
|
|
||||||
|
screenFramebuffer.bind(OpenGL::DrawFramebuffer);
|
||||||
|
gl.setClearColour(0.f, 0.f, 0.f, 1.f);
|
||||||
|
OpenGL::clearColor();
|
||||||
|
|
||||||
using namespace PICA::ExternalRegs;
|
using namespace PICA::ExternalRegs;
|
||||||
const u32 topActiveFb = externalRegs[Framebuffer0Select] & 1;
|
const u32 topActiveFb = externalRegs[Framebuffer0Select] & 1;
|
||||||
const u32 topScreenAddr = externalRegs[topActiveFb == 0 ? Framebuffer0AFirstAddr : Framebuffer0ASecondAddr];
|
const u32 topScreenAddr = externalRegs[topActiveFb == 0 ? Framebuffer0AFirstAddr : Framebuffer0ASecondAddr];
|
||||||
const u32 bottomActiveFb = externalRegs[Framebuffer1Select] & 1;
|
|
||||||
const u32 bottomScreenAddr = externalRegs[bottomActiveFb == 0 ? Framebuffer1AFirstAddr : Framebuffer1ASecondAddr];
|
|
||||||
|
|
||||||
auto topScreen = colourBufferCache.findFromAddress(topScreenAddr);
|
auto topScreen = colourBufferCache.findFromAddress(topScreenAddr);
|
||||||
auto bottomScreen = colourBufferCache.findFromAddress(bottomScreenAddr);
|
|
||||||
screenFramebuffer.bind(OpenGL::DrawFramebuffer);
|
|
||||||
|
|
||||||
gl.setClearColour(0.f, 0.f, 0.f, 1.f);
|
|
||||||
OpenGL::clearColor();
|
|
||||||
|
|
||||||
if (topScreen) {
|
if (topScreen) {
|
||||||
topScreen->get().texture.bind();
|
topScreen->get().texture.bind();
|
||||||
|
@ -484,6 +482,10 @@ void RendererGL::display() {
|
||||||
OpenGL::draw(OpenGL::TriangleStrip, 4); // Actually draw our 3DS screen
|
OpenGL::draw(OpenGL::TriangleStrip, 4); // Actually draw our 3DS screen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const u32 bottomActiveFb = externalRegs[Framebuffer1Select] & 1;
|
||||||
|
const u32 bottomScreenAddr = externalRegs[bottomActiveFb == 0 ? Framebuffer1AFirstAddr : Framebuffer1ASecondAddr];
|
||||||
|
auto bottomScreen = colourBufferCache.findFromAddress(bottomScreenAddr);
|
||||||
|
|
||||||
if (bottomScreen) {
|
if (bottomScreen) {
|
||||||
bottomScreen->get().texture.bind();
|
bottomScreen->get().texture.bind();
|
||||||
OpenGL::setViewport(40, 0, 320, 240);
|
OpenGL::setViewport(40, 0, 320, 240);
|
||||||
|
|
Loading…
Add table
Reference in a new issue