clear render targets after creation
This commit is contained in:
@@ -12,7 +12,7 @@ struct BufferHandle {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 64MB buffer for caching vertex data
|
// 64MB buffer for caching vertex data
|
||||||
#define CACHE_BUFFER_SIZE 64 * 1024 * 1024
|
#define CACHE_BUFFER_SIZE 128 * 1024 * 1024
|
||||||
|
|
||||||
class VertexBufferCache {
|
class VertexBufferCache {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ void RendererMTL::textureCopy(u32 inputAddr, u32 outputAddr, u32 totalBytes, u32
|
|||||||
// Find the source surface.
|
// Find the source surface.
|
||||||
auto srcFramebuffer = getColorRenderTarget(inputAddr, PICA::ColorFmt::RGBA8, copyStride, copyHeight, false);
|
auto srcFramebuffer = getColorRenderTarget(inputAddr, PICA::ColorFmt::RGBA8, copyStride, copyHeight, false);
|
||||||
if (!srcFramebuffer) {
|
if (!srcFramebuffer) {
|
||||||
Helpers::warn("RendererGL::TextureCopy failed to locate src framebuffer!\n");
|
Helpers::warn("RendererMTL::TextureCopy failed to locate src framebuffer!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nextRenderPassName = "Clear before texture copy";
|
nextRenderPassName = "Clear before texture copy";
|
||||||
@@ -605,7 +605,12 @@ std::optional<Metal::ColorRenderTarget> RendererMTL::getColorRenderTarget(
|
|||||||
// Otherwise create and cache a new buffer.
|
// Otherwise create and cache a new buffer.
|
||||||
Metal::ColorRenderTarget sampleBuffer(device, addr, format, width, height);
|
Metal::ColorRenderTarget sampleBuffer(device, addr, format, width, height);
|
||||||
|
|
||||||
return colorRenderTargetCache.add(sampleBuffer);
|
auto& colorBuffer = colorRenderTargetCache.add(sampleBuffer);
|
||||||
|
|
||||||
|
// Clear the color buffer
|
||||||
|
colorClearOps[colorBuffer.texture] = {0, 0, 0, 0};
|
||||||
|
|
||||||
|
return colorBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
Metal::DepthStencilRenderTarget& RendererMTL::getDepthRenderTarget() {
|
Metal::DepthStencilRenderTarget& RendererMTL::getDepthRenderTarget() {
|
||||||
@@ -615,7 +620,15 @@ Metal::DepthStencilRenderTarget& RendererMTL::getDepthRenderTarget() {
|
|||||||
if (buffer.has_value()) {
|
if (buffer.has_value()) {
|
||||||
return buffer.value().get();
|
return buffer.value().get();
|
||||||
} else {
|
} else {
|
||||||
return depthStencilRenderTargetCache.add(sampleBuffer);
|
auto& depthBuffer = depthStencilRenderTargetCache.add(sampleBuffer);
|
||||||
|
|
||||||
|
// Clear the depth buffer
|
||||||
|
depthClearOps[depthBuffer.texture] = 0.0f;
|
||||||
|
if (depthBuffer.format == DepthFmt::Depth24Stencil8) {
|
||||||
|
stencilClearOps[depthBuffer.texture] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return depthBuffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user