Skip to content

Commit

Permalink
Vulkan: Use the very same view as input attachment and color attachme…
Browse files Browse the repository at this point in the history
…nt, not just the same image

Fixes most of the new validation errors seen #16351, though one remains.

I believe that to be a bug in the validation layers, will investigate
later.
  • Loading branch information
hrydgard committed Nov 7, 2022
1 parent a04d7c9 commit 668904a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Common/GPU/Vulkan/VulkanDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback(
// UNASSIGNED
return false;
}
if (messageCode == 606910136) {
// VUID-vkCmdDraw-None-02686
// Seems to be a bug in the validation layers, in the check that the input attachment is bound to a descriptor.
return false;
}

if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {
message << "ERROR(";
Expand Down
7 changes: 2 additions & 5 deletions Common/GPU/Vulkan/thin3d_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Common/GPU/thin3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion GPU/Vulkan/StateMappingVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ 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 {
Expand Down

0 comments on commit 668904a

Please sign in to comment.