X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fprogram_backend.cpp;h=10c04d83e7eabe6c6cb3cd7b79f5dfbc84ee7b34;hb=9eb9f592d37e9a1e05c2ff70887a1c5f26b98864;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..10c04d83 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,17 @@ void VulkanProgram::finalize_uniforms() #endif } +bool VulkanProgram::is_compute() const +{ + return stage_flags&VK_SHADER_STAGE_COMPUTE_BIT; +} + +bool VulkanProgram::has_tessellation() const +{ + constexpr unsigned tess_flags = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; + return (stage_flags&tess_flags)==tess_flags; +} + void VulkanProgram::set_debug_name(const string &name) { #ifdef DEBUG