@@ -19,6 +19,15 @@ namespace Vulkan {
19
19
20
20
using Shader::Backend::SPIRV::AuxShaderType;
21
21
22
+ static constexpr std::array LogicalStageToStageBit = {
23
+ vk::ShaderStageFlagBits::eFragment,
24
+ vk::ShaderStageFlagBits::eTessellationControl,
25
+ vk::ShaderStageFlagBits::eTessellationEvaluation,
26
+ vk::ShaderStageFlagBits::eVertex,
27
+ vk::ShaderStageFlagBits::eGeometry,
28
+ vk::ShaderStageFlagBits::eCompute,
29
+ };
30
+
22
31
GraphicsPipeline::GraphicsPipeline (
23
32
const Instance& instance, Scheduler& scheduler, DescriptorHeap& desc_heap,
24
33
const Shader::Profile& profile, const GraphicsPipelineKey& key_,
@@ -34,7 +43,7 @@ GraphicsPipeline::GraphicsPipeline(
34
43
const auto debug_str = GetDebugString ();
35
44
36
45
const vk::PushConstantRange push_constants = {
37
- .stageFlags = gp_stage_flags ,
46
+ .stageFlags = AllGraphicsStageBits ,
38
47
.offset = 0 ,
39
48
.size = sizeof (Shader::PushData),
40
49
};
@@ -352,6 +361,7 @@ void GraphicsPipeline::BuildDescSetLayout() {
352
361
if (!stage) {
353
362
continue ;
354
363
}
364
+ const auto stage_bit = LogicalStageToStageBit[u32 (stage->l_stage )];
355
365
for (const auto & buffer : stage->buffers ) {
356
366
const auto sharp = buffer.GetSharp (*stage);
357
367
bindings.push_back ({
@@ -360,7 +370,7 @@ void GraphicsPipeline::BuildDescSetLayout() {
360
370
? vk::DescriptorType::eStorageBuffer
361
371
: vk::DescriptorType::eUniformBuffer,
362
372
.descriptorCount = 1 ,
363
- .stageFlags = gp_stage_flags ,
373
+ .stageFlags = stage_bit ,
364
374
});
365
375
}
366
376
for (const auto & image : stage->images ) {
@@ -369,15 +379,15 @@ void GraphicsPipeline::BuildDescSetLayout() {
369
379
.descriptorType = image.is_written ? vk::DescriptorType::eStorageImage
370
380
: vk::DescriptorType::eSampledImage,
371
381
.descriptorCount = 1 ,
372
- .stageFlags = gp_stage_flags ,
382
+ .stageFlags = stage_bit ,
373
383
});
374
384
}
375
385
for (const auto & sampler : stage->samplers ) {
376
386
bindings.push_back ({
377
387
.binding = binding++,
378
388
.descriptorType = vk::DescriptorType::eSampler,
379
389
.descriptorCount = 1 ,
380
- .stageFlags = gp_stage_flags ,
390
+ .stageFlags = stage_bit ,
381
391
});
382
392
}
383
393
}
0 commit comments