mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-11 00:25:41 +12:00
[GL] Fix depth mask getting corrupted, remove dead code
This commit is contained in:
parent
1d3b078dfb
commit
79a341a297
1 changed files with 3 additions and 13 deletions
|
@ -461,9 +461,6 @@ void RendererGL::drawVertices(PICA::PrimType primType, std::span<const Vertex> v
|
|||
OpenGL::draw(primitiveTopology, GLsizei(vertices.size()));
|
||||
}
|
||||
|
||||
constexpr u32 topScreenBuffer = 0x1f000000;
|
||||
constexpr u32 bottomScreenBuffer = 0x1f05dc00;
|
||||
|
||||
void RendererGL::display() {
|
||||
gl.disableScissor();
|
||||
|
||||
|
@ -475,15 +472,6 @@ void RendererGL::display() {
|
|||
void RendererGL::clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control) {
|
||||
log("GPU: Clear buffer\nStart: %08X End: %08X\nValue: %08X Control: %08X\n", startAddress, endAddress, value, control);
|
||||
|
||||
if (startAddress == topScreenBuffer) {
|
||||
log("GPU: Cleared top screen\n");
|
||||
} else if (startAddress == bottomScreenBuffer) {
|
||||
log("GPU: Tried to clear bottom screen\n");
|
||||
return;
|
||||
} else {
|
||||
log("GPU: Clearing some unknown buffer\n");
|
||||
}
|
||||
|
||||
const auto color = colourBufferCache.findFromAddress(startAddress);
|
||||
if (color) {
|
||||
const float r = getBits<24, 8>(value) / 255.0f;
|
||||
|
@ -507,14 +495,16 @@ void RendererGL::clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 co
|
|||
depthVal = (value & 0xffffff) / 16777215.0f;
|
||||
}
|
||||
depth->get().fbo.bind(OpenGL::DrawFramebuffer);
|
||||
OpenGL::setDepthMask(true);
|
||||
gl.setDepthMask(true);
|
||||
OpenGL::setClearDepth(depthVal);
|
||||
OpenGL::clearDepth();
|
||||
if (format == DepthFmt::Depth24Stencil8) {
|
||||
const u8 stencil = (value >> 24);
|
||||
OpenGL::setStencilMask(0xFF);
|
||||
OpenGL::setClearStencil(stencil);
|
||||
OpenGL::clearStencil();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue