diff --git a/interface/vulkan/pipeline/DeferredLightRenderer.cppm b/interface/vulkan/pipeline/DeferredLightRenderer.cppm index 3823748..74af2e8 100644 --- a/interface/vulkan/pipeline/DeferredLightRenderer.cppm +++ b/interface/vulkan/pipeline/DeferredLightRenderer.cppm @@ -31,10 +31,34 @@ namespace vk_deferred::vulkan::inline pipeline { }), } }, pipeline { device, nullptr, vku::getDefaultGraphicsPipelineCreateInfo( +#ifdef _MSC_VER + // TODO: due to the MSVC C++20 module bug, vku::createPipelineStages not works well. Use it instead when fixed. + vku::unsafeProxy({ + vk::PipelineShaderStageCreateInfo { + {}, + vk::ShaderStageFlagBits::eVertex, + *vk::raii::ShaderModule { device, vk::ShaderModuleCreateInfo { + {}, + vku::unsafeProxy(vku::Shader { COMPILED_SHADER_DIR "/light_volume.vert.spv", vk::ShaderStageFlagBits::eVertex }.code), + } }, + "main", + }, + vk::PipelineShaderStageCreateInfo { + {}, + vk::ShaderStageFlagBits::eFragment, + *vk::raii::ShaderModule { device, vk::ShaderModuleCreateInfo { + {}, + vku::unsafeProxy(vku::Shader { COMPILED_SHADER_DIR "/deferred_lighting.frag.spv", vk::ShaderStageFlagBits::eFragment }.code), + } }, + "main", + }, + }), +#else createPipelineStages( device, vku::Shader { COMPILED_SHADER_DIR "/light_volume.vert.spv", vk::ShaderStageFlagBits::eVertex }, vku::Shader { COMPILED_SHADER_DIR "/deferred_lighting.frag.spv", vk::ShaderStageFlagBits::eFragment }).get(), +#endif *pipelineLayout, 1, true) .setPVertexInputState(vku::unsafeAddress(vk::PipelineVertexInputStateCreateInfo { {}, diff --git a/interface/vulkan/pipeline/GBufferRenderer.cppm b/interface/vulkan/pipeline/GBufferRenderer.cppm index 6087b7e..78bdcc7 100644 --- a/interface/vulkan/pipeline/GBufferRenderer.cppm +++ b/interface/vulkan/pipeline/GBufferRenderer.cppm @@ -28,10 +28,34 @@ namespace vk_deferred::vulkan::inline pipeline { }), } }, pipeline { device, nullptr, vku::getDefaultGraphicsPipelineCreateInfo( +#ifdef _MSC_VER + // TODO: due to the MSVC C++20 module bug, vku::createPipelineStages not works well. Use it instead when fixed. + vku::unsafeProxy({ + vk::PipelineShaderStageCreateInfo { + {}, + vk::ShaderStageFlagBits::eVertex, + *vk::raii::ShaderModule { device, vk::ShaderModuleCreateInfo { + {}, + vku::unsafeProxy(vku::Shader { COMPILED_SHADER_DIR "/pn_instanced.vert.spv", vk::ShaderStageFlagBits::eVertex }.code), + } }, + "main", + }, + vk::PipelineShaderStageCreateInfo { + {}, + vk::ShaderStageFlagBits::eFragment, + *vk::raii::ShaderModule { device, vk::ShaderModuleCreateInfo { + {}, + vku::unsafeProxy(vku::Shader { COMPILED_SHADER_DIR "/gbuffer.frag.spv", vk::ShaderStageFlagBits::eFragment }.code), + } }, + "main", + }, + }), +#else createPipelineStages( device, vku::Shader { COMPILED_SHADER_DIR "/pn_instanced.vert.spv", vk::ShaderStageFlagBits::eVertex }, vku::Shader { COMPILED_SHADER_DIR "/gbuffer.frag.spv", vk::ShaderStageFlagBits::eFragment }).get(), +#endif *pipelineLayout, 2, true) .setPVertexInputState(vku::unsafeAddress(vk::PipelineVertexInputStateCreateInfo { {}, diff --git a/interface/vulkan/pipeline/ToneMappingRenderer.cppm b/interface/vulkan/pipeline/ToneMappingRenderer.cppm index 1760036..34854c3 100644 --- a/interface/vulkan/pipeline/ToneMappingRenderer.cppm +++ b/interface/vulkan/pipeline/ToneMappingRenderer.cppm @@ -22,10 +22,34 @@ namespace vk_deferred::vulkan::inline pipeline { vku::unsafeProxy(*descriptorSetLayout), } }, pipeline { device, nullptr, vku::getDefaultGraphicsPipelineCreateInfo( +#ifdef _MSC_VER + // TODO: due to the MSVC C++20 module bug, vku::createPipelineStages not works well. Use it instead when fixed. + vku::unsafeProxy({ + vk::PipelineShaderStageCreateInfo { + {}, + vk::ShaderStageFlagBits::eVertex, + *vk::raii::ShaderModule { device, vk::ShaderModuleCreateInfo { + {}, + vku::unsafeProxy(vku::Shader { COMPILED_SHADER_DIR "/full_triangle.vert.spv", vk::ShaderStageFlagBits::eVertex }.code), + } }, + "main", + }, + vk::PipelineShaderStageCreateInfo { + {}, + vk::ShaderStageFlagBits::eFragment, + *vk::raii::ShaderModule { device, vk::ShaderModuleCreateInfo { + {}, + vku::unsafeProxy(vku::Shader { COMPILED_SHADER_DIR "/rec709.frag.spv", vk::ShaderStageFlagBits::eFragment }.code), + } }, + "main", + }, + }), +#else createPipelineStages( device, vku::Shader { COMPILED_SHADER_DIR "/full_triangle.vert.spv", vk::ShaderStageFlagBits::eVertex }, vku::Shader { COMPILED_SHADER_DIR "/rec709.frag.spv", vk::ShaderStageFlagBits::eFragment }).get(), +#endif *pipelineLayout, 1) .setRenderPass(*renderPass) .setSubpass(2)