X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fpipelinestate_backend.cpp;h=9e6db92fd3b8e2a3a07ccfef9f2e8f490a0df064;hb=refs%2Fheads%2Fmaster;hp=5d1139b8762ad8bee543f6aebe2039fce890282a;hpb=ea689bc784d3cda28c2b1b558a294fe52236f7dd;p=libs%2Fgl.git diff --git a/source/backends/vulkan/pipelinestate_backend.cpp b/source/backends/vulkan/pipelinestate_backend.cpp index 5d1139b8..9e6db92f 100644 --- a/source/backends/vulkan/pipelinestate_backend.cpp +++ b/source/backends/vulkan/pipelinestate_backend.cpp @@ -196,7 +196,7 @@ void VulkanPipelineState::fill_graphics_creation_info(vector &buffer) cons input_assembly_info->sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; input_assembly_info->topology = static_cast(get_vulkan_primitive_type(self.primitive_type)); - input_assembly_info->primitiveRestartEnable = !has_tessellation; + input_assembly_info->primitiveRestartEnable = (self.primitive_type!=POINTS && self.primitive_type!=LINES && self.primitive_type!=TRIANGLES && self.primitive_type!=PATCHES); if(has_tessellation) { @@ -460,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