Merge pull request #16354 from hrydgard/vulkan-input-attachment-fix

Vulkan: Use the very same view as input attachment and color attachment, not just the same image
This commit is contained in:
Henrik Rydgård 2022-11-07 10:20:48 +01:00 committed by GitHub
commit c6116581b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 7 deletions

View File

@ -42,6 +42,12 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback(
// UNASSIGNED
return false;
}
if (messageCode == 606910136 || messageCode == -392708513) {
// VUID-vkCmdDraw-None-02686
// Kinda false positive, or at least very unnecessary, now that I solved the real issue.
// See https://github.com/hrydgard/ppsspp/pull/16354
return false;
}
if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {
message << "ERROR(";

View File

@ -1703,11 +1703,8 @@ uint64_t VKContext::GetNativeObject(NativeObject obj, void *srcObject) {
return (uint64_t)(((VKTexture *)srcObject)->GetImageView());
case NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_ALL_LAYERS:
return (uint64_t)curFramebuffer_->GetFB()->color.texAllLayersView;
case NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_LAYER: {
size_t layer = (size_t)srcObject;
_dbg_assert_(layer < curFramebuffer_->Layers());
return (uint64_t)curFramebuffer_->GetFB()->color.texLayerViews[layer];
}
case NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_RT:
return (uint64_t)curFramebuffer_->GetFB()->color.rtView;
case NativeObject::FRAME_DATA_DESC_SET_LAYOUT:
return (uint64_t)frameDescSetLayout_;
case NativeObject::THIN3D_PIPELINE_LAYOUT:

View File

@ -245,7 +245,7 @@ enum class NativeObject {
BOUND_TEXTURE0_IMAGEVIEW, // Layer etc depends on how you bound it...
BOUND_TEXTURE1_IMAGEVIEW, // Layer etc depends on how you bound it...
BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_ALL_LAYERS,
BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_LAYER, // use an int cast to void *srcObject to specify layer.
BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_RT,
RENDER_MANAGER,
TEXTURE_VIEW,
NULL_IMAGEVIEW,

View File

@ -377,10 +377,11 @@ void DrawEngineVulkan::BindShaderBlendTex() {
dirtyRequiresRecheck_ |= DIRTY_BLEND_STATE;
} else if (fboTexBindState_ == FBO_TEX_READ_FRAMEBUFFER) {
draw_->BindCurrentFramebufferForColorInput();
boundSecondary_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_LAYER, (void *)0);
boundSecondary_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_RT, (void *)0);
boundSecondaryIsInputAttachment_ = true;
fboTexBindState_ = FBO_TEX_NONE;
} else {
boundSecondaryIsInputAttachment_ = false;
boundSecondary_ = VK_NULL_HANDLE;
}
}