1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-09 02:53:57 +02:00

[dxvk] Don't create shader modules for internal clear pipelines

This commit is contained in:
Philip Rebohle 2025-03-23 22:28:24 +01:00
parent 1b77415607
commit 662df399b2
2 changed files with 21 additions and 21 deletions

View File

@ -149,22 +149,16 @@ namespace dxvk {
VkPipeline DxvkMetaClearObjects::createPipeline(
const SpirvCodeBuffer& spirvCode,
size_t size,
const uint32_t* code,
VkPipelineLayout pipeLayout) {
VkShaderModuleCreateInfo shaderInfo = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO };
shaderInfo.codeSize = spirvCode.size();
shaderInfo.pCode = spirvCode.data();
shaderInfo.codeSize = size;
shaderInfo.pCode = code;
VkShaderModule shaderModule = VK_NULL_HANDLE;
if (m_vkd->vkCreateShaderModule(m_vkd->device(),
&shaderInfo, nullptr, &shaderModule) != VK_SUCCESS)
throw DxvkError("Dxvk: Failed to create meta clear shader module");
VkPipelineShaderStageCreateInfo stageInfo = { VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO };
VkPipelineShaderStageCreateInfo stageInfo = { VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, &shaderInfo };
stageInfo.stage = VK_SHADER_STAGE_COMPUTE_BIT;
stageInfo.module = shaderModule;
stageInfo.pName = "main";
stageInfo.pSpecializationInfo = nullptr;
VkComputePipelineCreateInfo pipeInfo = { VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO };
pipeInfo.stage = stageInfo;
@ -176,8 +170,6 @@ namespace dxvk {
const VkResult status = m_vkd->vkCreateComputePipelines(
m_vkd->device(), VK_NULL_HANDLE, 1, &pipeInfo, nullptr, &result);
m_vkd->vkDestroyShaderModule(m_vkd->device(), shaderModule, nullptr);
if (status != VK_SUCCESS)
throw DxvkError("Dxvk: Failed to create meta clear compute pipeline");
return result;

View File

@ -103,9 +103,17 @@ namespace dxvk {
VkDescriptorSetLayout dsetLayout);
VkPipeline createPipeline(
const SpirvCodeBuffer& spirvCode,
size_t size,
const uint32_t* code,
VkPipelineLayout pipeLayout);
template<size_t N>
VkPipeline createPipeline(
const uint32_t (&code)[N],
VkPipelineLayout pipeLayout) {
return createPipeline(sizeof(uint32_t) * N, &code[0], pipeLayout);
}
};
}