tu: Implement extendedDynamicState3RasterizationSamples

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
This commit is contained in:
Connor Abbott 2022-09-29 18:59:02 +02:00 committed by Marge Bot
parent 01055198dc
commit 5e362c82c8
4 changed files with 18 additions and 3 deletions

View file

@ -2631,7 +2631,8 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
tu6_update_msaa_disable(cmd);
tu6_update_msaa_samples(cmd, pipeline->output.samples);
if (!(pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_MSAA_SAMPLES)))
tu6_update_msaa_samples(cmd, pipeline->output.samples);
if ((pipeline->dynamic_state_mask & BIT(VK_DYNAMIC_STATE_VIEWPORT)) &&
(pipeline->viewport.z_negative_one_to_one != cmd->state.z_negative_one_to_one)) {
@ -3188,6 +3189,15 @@ tu_CmdSetSampleMaskEXT(VkCommandBuffer commandBuffer,
cmd->state.dirty |= TU_CMD_DIRTY_BLEND;
}
VKAPI_ATTR void VKAPI_CALL
tu_CmdSetRasterizationSamplesEXT(VkCommandBuffer commandBuffer,
VkSampleCountFlagBits rasterizationSamples)
{
TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer);
tu6_update_msaa_samples(cmd, rasterizationSamples);
}
static void
tu_flush_for_access(struct tu_cache_state *cache,
enum tu_cmd_access_mask src_mask,

View file

@ -767,7 +767,7 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->extendedDynamicState3DepthClipEnable = true;
features->extendedDynamicState3LogicOpEnable = true;
features->extendedDynamicState3SampleMask = true;
features->extendedDynamicState3RasterizationSamples = false;
features->extendedDynamicState3RasterizationSamples = true;
features->extendedDynamicState3AlphaToCoverageEnable = false;
features->extendedDynamicState3AlphaToOneEnable = false;
features->extendedDynamicState3DepthClipNegativeOneToOne = false;

View file

@ -3742,6 +3742,9 @@ tu_pipeline_builder_parse_dynamic(struct tu_pipeline_builder *builder,
pipeline->blend.rb_blend_cntl_mask &=
~A6XX_RB_BLEND_CNTL_SAMPLE_MASK__MASK;
break;
case VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT:
pipeline->dynamic_state_mask |= BIT(TU_DYNAMIC_STATE_MSAA_SAMPLES);
break;
default:
assert(!"unsupported dynamic state");
break;
@ -3835,7 +3838,8 @@ tu_pipeline_builder_parse_libraries(struct tu_pipeline_builder *builder,
BIT(TU_DYNAMIC_STATE_BLEND) |
BIT(TU_DYNAMIC_STATE_LOGIC_OP) |
BIT(TU_DYNAMIC_STATE_LOGIC_OP_ENABLE) |
BIT(TU_DYNAMIC_STATE_COLOR_WRITE_ENABLE);
BIT(TU_DYNAMIC_STATE_COLOR_WRITE_ENABLE) |
BIT(TU_DYNAMIC_STATE_MSAA_SAMPLES);
}
if ((library->state &

View file

@ -37,6 +37,7 @@ enum tu_dynamic_state
TU_DYNAMIC_STATE_COLOR_WRITE_ENABLE,
TU_DYNAMIC_STATE_POLYGON_MODE,
TU_DYNAMIC_STATE_TESS_DOMAIN_ORIGIN,
TU_DYNAMIC_STATE_MSAA_SAMPLES,
/* re-use the line width enum as it uses GRAS_SU_CNTL: */
TU_DYNAMIC_STATE_RAST = VK_DYNAMIC_STATE_LINE_WIDTH,
};