mirror of
https://git.citron-emu.org/Citron/Citron.git
synced 2025-01-22 16:46:59 +01:00
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.
This commit is contained in:
parent
dae1524eb5
commit
c65c8ac45e
1 changed files with 9 additions and 0 deletions
|
@ -767,6 +767,15 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
|
||||||
}
|
}
|
||||||
|
|
||||||
auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};
|
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)};
|
const std::vector<u32> code{EmitSPIRV(profile, program)};
|
||||||
device.SaveShader(code);
|
device.SaveShader(code);
|
||||||
vk::ShaderModule spv_module{BuildShader(device, code)};
|
vk::ShaderModule spv_module{BuildShader(device, code)};
|
||||||
|
|
Loading…
Reference in a new issue