core: Use compatible descriptor set layout for tile clipping (#4470)

This commit is contained in:
Adrian Cojocaru
2026-08-11 18:18:44 +03:00
committed by GitHub
parent b0388d186d
commit 7f430aa624
2 changed files with 16 additions and 5 deletions

View File

@@ -88,8 +88,20 @@ ShaderProgram::ShaderProgram(shaders::BuiltIn shaderID,
const auto intermediate = glslProgram.getIntermediate(language);
glslang::SpvOptions options;
options.disableOptimizer = false;
options.optimizeSize = true;
#ifndef _NDEBUG
options.generateDebugInfo = true;
options.validate = true;
#else
options.stripDebugInfo = true;
#endif
std::vector<uint32_t> spirv;
glslang::GlslangToSpv(*intermediate, spirv);
glslang::GlslangToSpv(*intermediate, spirv, &options);
return spirv;
};

View File

@@ -579,6 +579,7 @@ bool Context::renderTileClippingMasks(gfx::RenderPass& renderPass,
clipping.pipelineInfo.stencilPass = vk::StencilOp::eReplace;
clipping.pipelineInfo.dynamicValues.stencilWriteMask = 0b11111111;
clipping.pipelineInfo.dynamicValues.stencilRef = 0b11111111;
clipping.pipelineInfo.dynamicValues.stencilCompareMask = 0xFF;
clipping.pipelineInfo.inputBindings.push_back(
vk::VertexInputBindingDescription()
@@ -591,6 +592,8 @@ bool Context::renderTileClippingMasks(gfx::RenderPass& renderPass,
.setBinding(0)
.setLocation(static_cast<uint32_t>(ShaderClass::attributes[0].index))
.setFormat(PipelineInfo::vulkanFormat(ShaderClass::attributes[0].dataType)));
clipping.pipelineInfo.updateVertexInputHash();
}
const auto& dispatcher = backend.getDispatcher();
@@ -773,9 +776,6 @@ const vk::UniquePipelineLayout& Context::getPushConstantPipelineLayout() {
auto layoutInfo = vk::PipelineLayoutCreateInfo().setPushConstantRanges(pushConstant);
#ifdef ENABLE_VULKAN_GPU_ASSISTED_VALIDATION
// GPU assisted validation crashes when using a pipeline without descriptors.
// Use a compatible layout with the general pipeline when enabled
const std::vector<vk::DescriptorSetLayout> layouts = {
globalUniformDescriptorSetLayout.get(),
layerUniformDescriptorSetLayout.get(),
@@ -784,7 +784,6 @@ const vk::UniquePipelineLayout& Context::getPushConstantPipelineLayout() {
};
layoutInfo.setSetLayouts(layouts);
#endif
pushConstantPipelineLayout = backend.getDevice()->createPipelineLayoutUnique(
layoutInfo, nullptr, backend.getDispatcher());