X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fprogram_backend.cpp;h=993a3e38ef965d11b838fb9b41653cb2fe5b3b29;hb=cebf1330ef6773b7b4496dc279ec02a7ca4351bb;hp=9402226b1e68917bf00273bd10ae31ff519d3f4c;hpb=f6cb2d0e13b78007a5c57b06c270b7386130d4b4;p=libs%2Fgl.git diff --git a/source/backends/vulkan/program_backend.cpp b/source/backends/vulkan/program_backend.cpp index 9402226b..993a3e38 100644 --- a/source/backends/vulkan/program_backend.cpp +++ b/source/backends/vulkan/program_backend.cpp @@ -138,7 +138,10 @@ void VulkanProgram::finalize_uniforms() bindings.emplace_back(); VkDescriptorSetLayoutBinding &binding = bindings.back(); binding.binding = u.binding&0xFFFFF; - binding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + if(is_sampled_image(u.type)) + binding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + else + binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; binding.descriptorCount = 1; binding.stageFlags = stage_flags; binding.pImmutableSamplers = 0; @@ -172,6 +175,11 @@ void VulkanProgram::finalize_uniforms() #endif } +bool VulkanProgram::is_compute() const +{ + return stage_flags&VK_SHADER_STAGE_COMPUTE_BIT; +} + void VulkanProgram::set_debug_name(const string &name) { #ifdef DEBUG