X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fpipelinestate_backend.cpp;h=d8e4d4a1978504373e5614aad6e59555d358e955;hb=4369f481b06d28056deceecbfcb69550a65c92dc;hp=f06e2d324a82e9302135b46c49d7401b9c008f4a;hpb=9eb9f592d37e9a1e05c2ff70887a1c5f26b98864;p=libs%2Fgl.git diff --git a/source/backends/vulkan/pipelinestate_backend.cpp b/source/backends/vulkan/pipelinestate_backend.cpp index f06e2d32..d8e4d4a1 100644 --- a/source/backends/vulkan/pipelinestate_backend.cpp +++ b/source/backends/vulkan/pipelinestate_backend.cpp @@ -448,6 +448,10 @@ unsigned VulkanPipelineState::fill_descriptor_writes(unsigned index, unsigned fr ++write_ptr; } +#ifdef DEBUG + self.check_bound_resources(); +#endif + return n_writes; } @@ -456,8 +460,13 @@ void VulkanPipelineState::synchronize_resources() const const PipelineState &self = *static_cast(this); for(const PipelineState::BoundResource &r: self.resources) - if(r.type==PipelineState::STORAGE_TEXTURE) - r.texture->change_layout(-1, VK_IMAGE_LAYOUT_GENERAL, false); + if(r.used) + { + if(r.type==PipelineState::STORAGE_TEXTURE) + r.texture->change_layout(-1, VK_IMAGE_LAYOUT_GENERAL, false); + else if(r.type==PipelineState::SAMPLED_TEXTURE) + r.texture->change_layout(-1, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, false); + } } void VulkanPipelineState::apply(const VulkanCommandRecorder &vkCmd, const VulkanPipelineState *last, unsigned frame, bool negative_viewport) const