static void radv_set_rt_stack_size(struct radv_cmd_buffer *cmd_buffer, uint32_t size);
-const struct radv_dynamic_state default_dynamic_state = {
- .vk =
- {
- .ia =
- {
- .primitive_topology = 0u,
- .primitive_restart_enable = 0u,
- },
- .vp =
- {
- .depth_clip_negative_one_to_one = 0u,
- .viewport_count = 0,
- .scissor_count = 0,
- },
- .ts =
- {
- .patch_control_points = 0,
- .domain_origin = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT,
- },
- .rs =
- {
- .rasterizer_discard_enable = 0u,
- .depth_clamp_enable = 0u,
- .depth_clip_enable = 0u,
- .depth_bias =
- {
- .enable = 0,
- .constant = 0.0f,
- .clamp = 0.0f,
- .slope = 0.0f,
- },
- .polygon_mode = 0,
- .cull_mode = 0,
- .front_face = 0u,
- .conservative_mode = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT,
- .provoking_vertex = VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT,
- .line =
- {
- .width = 1.0f,
- .mode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT,
- .stipple =
- {
- .enable = 0u,
- .factor = 0u,
- .pattern = 0u,
- },
- },
- },
- .fsr =
- {
- .fragment_size = {1u, 1u},
- .combiner_ops = {VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR,
- VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR},
- },
- .ds =
- {
- .depth =
- {
- .bounds_test =
- {
- .min = 0.0f,
- .max = 1.0f,
- },
- },
- .stencil =
- {
- .front =
- {
- .reference = 0u,
- .compare_mask = ~0,
- .write_mask = ~0,
- },
- .back =
- {
- .reference = 0u,
- .compare_mask = ~0,
- .write_mask = ~0,
- },
- },
- },
- .ms = {
- .rasterization_samples = VK_SAMPLE_COUNT_1_BIT,
- .alpha_to_coverage_enable = 0u,
- .sample_mask = 0u,
- },
- .cb = {
- .logic_op_enable = 0u,
- .blend_constants = {0.0f, 0.0f, 0.0f, 0.0f},
- },
- },
-};
-
static void
radv_bind_dynamic_state(struct radv_cmd_buffer *cmd_buffer, const struct radv_dynamic_state *src)
{
const struct vk_graphics_pipeline_state *state)
{
uint64_t needed_states = radv_pipeline_needed_dynamic_state(pipeline, state);
+ struct radv_dynamic_state *dynamic = &pipeline->dynamic_state;
uint64_t states = needed_states;
- pipeline->dynamic_state = default_dynamic_state;
+ /* Initialize non-zero values for default dynamic state. */
+ dynamic->vk.rs.line.width = 1.0f;
+ dynamic->vk.fsr.fragment_size.width = 1u;
+ dynamic->vk.fsr.fragment_size.height = 1u;
+ dynamic->vk.ds.depth.bounds_test.max = 1.0f;
+ dynamic->vk.ds.stencil.front.compare_mask = ~0;
+ dynamic->vk.ds.stencil.front.write_mask = ~0;
+ dynamic->vk.ds.stencil.back.compare_mask = ~0;
+ dynamic->vk.ds.stencil.back.write_mask = ~0;
+ dynamic->vk.ms.rasterization_samples = VK_SAMPLE_COUNT_1_BIT;
+
pipeline->needed_dynamic_state = needed_states;
states &= ~pipeline->dynamic_states;
- struct radv_dynamic_state *dynamic = &pipeline->dynamic_state;
-
/* Input assembly. */
if (states & RADV_DYNAMIC_PRIMITIVE_TOPOLOGY) {
dynamic->vk.ia.primitive_topology = si_translate_prim(state->ia->primitive_topology);