Permalink
Browse files

Merge pull request #10055 from unknownbrackets/vulkan-minor

Vulkan: Correct logicop dirtying
  • Loading branch information...
hrydgard committed Nov 5, 2017
2 parents efdd7b3 + ef55cf1 commit 79208f105c94b1eb4723ca9b4df010dbab41505d
@@ -198,7 +198,7 @@ bool FramebufferManagerCommon::ShouldDownloadFramebuffer(const VirtualFramebuffe
void FramebufferManagerCommon::SetNumExtraFBOs(int num) {
for (size_t i = 0; i < extraFBOs_.size(); i++) {
delete extraFBOs_[i];
extraFBOs_[i]->Release();
}
extraFBOs_.clear();
for (int i = 0; i < num; i++) {
@@ -620,7 +620,7 @@ void FramebufferManagerCommon::NotifyRenderFramebufferSwitched(VirtualFramebuffe
if (vfb->fbo) {
// This should only happen very briefly when toggling useBufferedRendering_.
textureCache_->NotifyFramebuffer(vfb->fb_address, vfb, NOTIFY_FB_DESTROYED);
delete vfb->fbo;
vfb->fbo->Release();
vfb->fbo = nullptr;
}
@@ -1173,7 +1173,7 @@ void FramebufferManagerCommon::ResizeFramebufFBO(VirtualFramebuffer *vfb, int w,
if (!useBufferedRendering_) {
if (vfb->fbo) {
delete vfb->fbo;
vfb->fbo->Release();
vfb->fbo = nullptr;
}
return;
@@ -789,7 +789,7 @@ void TextureCacheCommon::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFram
nextTexture_ = entry;
} else {
if (framebuffer->fbo) {
delete framebuffer->fbo;
framebuffer->fbo->Release();
framebuffer->fbo = nullptr;
}
Unbind();
@@ -738,7 +738,7 @@ void FramebufferManagerD3D11::DestroyAllFBOs() {
bvfbs_.clear();
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
tempFBOs_.clear();
@@ -131,7 +131,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
drawPixelsTex_->Release();
}
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
for (auto it = offscreenSurfaces_.begin(), end = offscreenSurfaces_.end(); it != end; ++it) {
it->second.surface->Release();
@@ -726,7 +726,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
bvfbs_.clear();
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
tempFBOs_.clear();
@@ -777,7 +777,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
success = GetRenderTargetFramebuffer(renderTarget, offscreen, w, h, buffer);
}
if (tempFBO) {
delete tempFBO;
tempFBO->Release();
}
}
@@ -254,7 +254,7 @@ FramebufferManagerGLES::~FramebufferManagerGLES() {
SetNumExtraFBOs(0);
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
delete [] pixelBufObj_;
@@ -1048,7 +1048,7 @@ void FramebufferManagerGLES::DestroyAllFBOs() {
bvfbs_.clear();
for (auto it = tempFBOs_.begin(), end = tempFBOs_.end(); it != end; ++it) {
delete it->second.fbo;
it->second.fbo->Release();
}
tempFBOs_.clear();
@@ -152,8 +152,13 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag
bool alphaMask = gstate.isClearModeAlphaMask();
key.colorWriteMask = (colorMask ? (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT) : 0) | (alphaMask ? VK_COLOR_COMPONENT_A_BIT : 0);
} else {
key.logicOpEnable = false;
key.logicOp = VK_LOGIC_OP_CLEAR;
if (gstate_c.Supports(GPU_SUPPORTS_LOGIC_OP) && gstate.isLogicOpEnabled() && gstate.getLogicOp() != GE_LOGIC_COPY) {
key.logicOpEnable = true;
key.logicOp = logicOps[gstate.getLogicOp()];
} else {
key.logicOpEnable = false;
key.logicOp = VK_LOGIC_OP_CLEAR;
}
// Set blend - unless we need to do it in the shader.
GenericBlendState blendState;
@@ -275,16 +280,6 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag
dynState.useStencil = false;
}
} else {
if (gstate_c.Supports(GPU_SUPPORTS_LOGIC_OP)) {
// Logic Ops
if (gstate.isLogicOpEnabled() && gstate.getLogicOp() != GE_LOGIC_COPY) {
key.logicOpEnable = true;
key.logicOp = logicOps[gstate.getLogicOp()];
} else {
key.logicOpEnable = false;
}
}
// Depth Test
if (gstate.isDepthTestEnabled()) {
key.depthTestEnable = true;

0 comments on commit 79208f1

Please sign in to comment.