summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2025-01-08 19:13:03 +1000
committerZephyron <zephyron@citron-emu.org>2025-01-08 19:13:03 +1000
commitc65c8ac45e1e795549942cde6d455a0437635f31 (patch)
tree2b6069fa4a4ccf26eb6eb22c6f32a195968a20eb /src/video_core
parentdae1524eb59fac4b4ca0889d220d25e55eccfc84 (diff)
vulkan: Add bindless texture constant buffer support in compute pipeline
Add support for bindless texture constant buffers in the compute pipeline creation process. When storage buffer descriptors are present, create a constant buffer descriptor to handle bindless textures. This fixes the "Failed to track bindless texture constant buffer" error. Changes: - Add constant buffer descriptor with index 0 and count 1 when storage buffers are present - Place descriptor creation before SPIR-V code generation to ensure proper shader compilation This resolves issues with bindless texture access in compute shaders.
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 30e0ee6ec..d1f06ce50 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -767,6 +767,15 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
}
auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};
+
+ // Add support for bindless texture constant buffer
+ if (program.info.storage_buffers_descriptors.size() > 0) {
+ Shader::ConstantBufferDescriptor desc;
+ desc.index = 0;
+ desc.count = 1;
+ program.info.constant_buffer_descriptors.push_back(desc);
+ }
+
const std::vector<u32> code{EmitSPIRV(profile, program)};
device.SaveShader(code);
vk::ShaderModule spv_module{BuildShader(device, code)};