Module: Mesa Branch: main Commit: 453c50bef940d2a88c4920bc492a731154fd10cf URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=453c50bef940d2a88c4920bc492a731154fd10cf
Author: George Ouzounoudis <geothr...@gmail.com> Date: Thu Aug 24 20:05:30 2023 +0300 nvk: Support extended dynamic state for rasterization stream This is needed for EXT_shader_object. Move to dynamic state. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872> --- src/nouveau/vulkan/nvk_cmd_draw.c | 5 ++++- src/nouveau/vulkan/nvk_graphics_pipeline.c | 8 -------- src/nouveau/vulkan/nvk_physical_device.c | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/nouveau/vulkan/nvk_cmd_draw.c b/src/nouveau/vulkan/nvk_cmd_draw.c index f1a555b9edf..1188f79b2cd 100644 --- a/src/nouveau/vulkan/nvk_cmd_draw.c +++ b/src/nouveau/vulkan/nvk_cmd_draw.c @@ -1177,7 +1177,7 @@ vk_to_nv9097_provoking_vertex(VkProvokingVertexModeEXT vk_mode) static void nvk_flush_rs_state(struct nvk_cmd_buffer *cmd) { - struct nv_push *p = nvk_cmd_buffer_push(cmd, 38); + struct nv_push *p = nvk_cmd_buffer_push(cmd, 40); const struct vk_dynamic_graphics_state *dyn = &cmd->vk.dynamic_graphics_state; @@ -1316,6 +1316,9 @@ nvk_flush_rs_state(struct nvk_cmd_buffer *cmd) .pattern = dyn->rs.line.stipple.pattern, }); } + + if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_RS_RASTERIZATION_STREAM)) + P_IMMD(p, NV9097, SET_RASTER_INPUT, dyn->rs.rasterization_stream); } static VkSampleLocationEXT diff --git a/src/nouveau/vulkan/nvk_graphics_pipeline.c b/src/nouveau/vulkan/nvk_graphics_pipeline.c index d4f3269db72..af2015e35c5 100644 --- a/src/nouveau/vulkan/nvk_graphics_pipeline.c +++ b/src/nouveau/vulkan/nvk_graphics_pipeline.c @@ -36,13 +36,6 @@ emit_pipeline_vp_state(struct nv_push *p, { } -static void -emit_pipeline_rs_state(struct nv_push *p, - const struct vk_rasterization_state *rs) -{ - P_IMMD(p, NV9097, SET_RASTER_INPUT, rs->rasterization_stream); -} - static void nvk_populate_fs_key(struct nak_fs_key *key, const struct vk_multisample_state *ms, @@ -397,7 +390,6 @@ nvk_graphics_pipeline_create(struct nvk_device *dev, if (state.ts) emit_pipeline_ts_state(&push, state.ts); if (state.vp) emit_pipeline_vp_state(&push, state.vp); - if (state.rs) emit_pipeline_rs_state(&push, state.rs); if (state.ms) emit_pipeline_ms_state(&push, state.ms, force_max_samples); emit_pipeline_ct_write_state(&push, state.cb, state.rp); diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index b7222678484..aead8a93c72 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -400,7 +400,7 @@ nvk_get_device_features(const struct nv_device_info *info, .extendedDynamicState3ColorBlendEnable = true, .extendedDynamicState3ColorBlendEquation = true, .extendedDynamicState3ColorWriteMask = true, - .extendedDynamicState3RasterizationStream = false, + .extendedDynamicState3RasterizationStream = true, .extendedDynamicState3ConservativeRasterizationMode = false, .extendedDynamicState3ExtraPrimitiveOverestimationSize = false, .extendedDynamicState3DepthClipEnable = true,