Skip to content

Commit 7e71d7f

Browse files
committed
Updated to use pipeline parameters for configuring the pipeline multisample state
1 parent e17cee5 commit 7e71d7f

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

vulkan-cpp/pipeline.cppm

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,25 @@ export namespace vk {
331331

332332

333333
//! @note Multi-sampling
334+
// p_info.rasterization
335+
// VkPipelineMultisampleStateCreateInfo multisampling_ci = {
336+
// .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
337+
// .rasterizationSamples = VK_SAMPLE_COUNT_1_BIT,
338+
// .sampleShadingEnable = false,
339+
// // .minSampleShading = 1.0f, // Optional
340+
// // .pSampleMask = nullptr, // Optional
341+
// // .alphaToCoverageEnable = VK_FALSE, // Optional
342+
// // .alphaToOneEnable = VK_FALSE, // Optional
343+
// };
344+
334345
VkPipelineMultisampleStateCreateInfo multisampling_ci = {
335346
.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
336-
.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT,
337-
.sampleShadingEnable = false,
338-
// .minSampleShading = 1.0f, // Optional
339-
// .pSampleMask = nullptr, // Optional
340-
// .alphaToCoverageEnable = VK_FALSE, // Optional
341-
// .alphaToOneEnable = VK_FALSE, // Optional
347+
.rasterizationSamples = static_cast<VkSampleCountFlagBits>(p_info.multisample.rasterization_samples),
348+
.sampleShadingEnable = p_info.multisample.shading_enabled,
349+
.minSampleShading = p_info.multisample.min_shading,
350+
.pSampleMask = p_info.multisample.p_sample_masks.data(),
351+
.alphaToCoverageEnable = p_info.multisample.alpha_to_coverage_enable,
352+
.alphaToOneEnable = p_info.multisample.alpha_to_one_enable,
342353
};
343354

344355
// Color blending Attachment -- blending color when the fragment returns

0 commit comments

Comments
 (0)