diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c index 140910a7c38..9b4ae9c9795 100644 --- a/src/vulkan/runtime/vk_graphics_state.c +++ b/src/vulkan/runtime/vk_graphics_state.c @@ -963,6 +963,17 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp, rp->depth_self_dependency = rsd_info->depthSelfDependency; rp->stencil_self_dependency = rsd_info->stencilSelfDependency; } + + const VkAttachmentSampleCountInfoAMD *asc_info = + vk_get_pipeline_sample_count_info_amd(info); + if (asc_info != NULL) { + assert(asc_info->colorAttachmentCount == rp->color_attachment_count); + for (uint32_t i = 0; i < asc_info->colorAttachmentCount; i++) { + rp->color_attachment_samples[i] = asc_info->pColorAttachmentSamples[i]; + } + + rp->depth_stencil_attachment_samples = asc_info->depthStencilAttachmentSamples; + } } static void diff --git a/src/vulkan/runtime/vk_graphics_state.h b/src/vulkan/runtime/vk_graphics_state.h index 560ec245723..05e32e53ce7 100644 --- a/src/vulkan/runtime/vk_graphics_state.h +++ b/src/vulkan/runtime/vk_graphics_state.h @@ -504,6 +504,12 @@ struct vk_render_pass_state { /** VkPipelineRenderingCreateInfo::stencilAttachmentFormat */ VkFormat stencil_attachment_format; + + /** VkAttachmentSampleCountInfoAMD::pColorAttachmentSamples */ + uint8_t color_attachment_samples[MESA_VK_MAX_COLOR_ATTACHMENTS]; + + /** VkAttachmentSampleCountInfoAMD::depthStencilAttachmentSamples */ + uint8_t depth_stencil_attachment_samples; }; /** Struct representing all dynamic graphics state