X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fprogram_backend.cpp;h=2e9518108eca16e32ba9de5d9325343c1b469a05;hb=542c01f2798ad38279b043011a5bf1d1b975eb07;hp=50d772639adbeaf83bf3fbea40be303622639c58;hpb=6d2e2a0bb28496a8c25b441009bdd2a1a1e72d81;p=libs%2Fgl.git diff --git a/source/backends/vulkan/program_backend.cpp b/source/backends/vulkan/program_backend.cpp index 50d77263..2e951810 100644 --- a/source/backends/vulkan/program_backend.cpp +++ b/source/backends/vulkan/program_backend.cpp @@ -22,7 +22,8 @@ VulkanProgram::VulkanProgram(VulkanProgram &&other): stage_flags(other.stage_flags), creation_info(move(other.creation_info)), desc_set_layout_handles(move(other.desc_set_layout_handles)), - layout_handle(other.layout_handle) + layout_handle(other.layout_handle), + debug_name(move(other.debug_name)) { other.desc_set_layout_handles.clear(); other.layout_handle = 0; @@ -43,7 +44,7 @@ bool VulkanProgram::has_stages() const return n_stages; } -void VulkanProgram::add_glsl_stages(const GlslModule &, const map &, TransientData &) +void VulkanProgram::add_glsl_stages(const GlslModule &, const map &) { throw invalid_operation("VulkanProgram::add_glsl_stages"); } @@ -99,6 +100,12 @@ void VulkanProgram::add_spirv_stages(const SpirVModule &mod, const map(this)->specialized_spirv) + spirv->set_debug_name(debug_name); +#endif } void VulkanProgram::finalize_uniforms() @@ -118,8 +125,8 @@ void VulkanProgram::finalize_uniforms() { bindings.emplace_back(); VkDescriptorSetLayoutBinding &binding = bindings.back(); - binding.binding = b.bind_point; - binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + binding.binding = b.bind_point&0xFFFFF; + binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; binding.descriptorCount = 1; binding.stageFlags = VK_SHADER_STAGE_ALL; binding.pImmutableSamplers = 0; @@ -130,7 +137,7 @@ void VulkanProgram::finalize_uniforms() { bindings.emplace_back(); VkDescriptorSetLayoutBinding &binding = bindings.back(); - binding.binding = u.binding; + binding.binding = u.binding&0xFFFFF; binding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; binding.descriptorCount = 1; binding.stageFlags = VK_SHADER_STAGE_ALL; @@ -160,5 +167,16 @@ void VulkanProgram::finalize_uniforms() vk.CreatePipelineLayout(layout_info, layout_handle); } +void VulkanProgram::set_debug_name(const string &name) +{ +#ifdef DEBUG + debug_name = name; + if(SpirVModule *spirv = static_cast(this)->specialized_spirv) + spirv->set_debug_name(debug_name); +#else + (void)name; +#endif +} + } // namespace GL } // namespace Msp