diff options
author | Tapani Pälli <tapani.palli@intel.com> | 2024-05-07 13:34:18 +0300 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-05-15 04:45:55 +0000 |
commit | 2ac5e70faecab51523151611640861f0e4092022 (patch) | |
tree | 798778914e17d401bd65187054fcf75efa9587e5 | |
parent | e7ce48557a4dc6a43a7db721aaad0f23ef0810af (diff) |
anv: VK_EXT_legacy_dithering support
Toggle on dithering if it has been enabled on device and is set on the
rendering flags used.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19414>
-rw-r--r-- | src/intel/vulkan/anv_device.c | 4 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 1 | ||||
-rw-r--r-- | src/intel/vulkan/genX_gfx_state.c | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 571ef69b835..3fc65e4ec27 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -372,6 +372,7 @@ get_device_extensions(const struct anv_physical_device *device, .EXT_image_view_min_lod = true, .EXT_index_type_uint8 = true, .EXT_inline_uniform_block = true, + .EXT_legacy_dithering = true, .EXT_legacy_vertex_attributes = true, .EXT_line_rasterization = true, .EXT_load_store_op_none = true, @@ -937,6 +938,9 @@ get_features(const struct anv_physical_device *pdevice, /* VK_EXT_legacy_vertex_attributes */ .legacyVertexAttributes = true, + + /* VK_EXT_legacy_dithering */ + .legacyDithering = true, }; /* The new DOOM and Wolfenstein games require depthBounds without diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 18af27da143..8afeaab1939 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1468,6 +1468,7 @@ struct anv_gfx_dynamic_state { bool AlphaToCoverageEnable; bool AlphaToOneEnable; bool IndependentAlphaBlendEnable; + bool ColorDitherEnable; struct { bool WriteDisableAlpha; bool WriteDisableRed; diff --git a/src/intel/vulkan/genX_gfx_state.c b/src/intel/vulkan/genX_gfx_state.c index ce788347571..504dc8aaae0 100644 --- a/src/intel/vulkan/genX_gfx_state.c +++ b/src/intel/vulkan/genX_gfx_state.c @@ -1060,6 +1060,8 @@ genX(cmd_buffer_flush_gfx_runtime_state)(struct anv_cmd_buffer *cmd_buffer) dyn->ms.alpha_to_coverage_enable); SET(BLEND_STATE, blend.AlphaToOneEnable, dyn->ms.alpha_to_one_enable); + SET(BLEND_STATE, blend.ColorDitherEnable, + cmd_buffer->state.gfx.rendering_flags & VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT); bool independent_alpha_blend = false; /* Wa_14018912822, check if we set these during RT setup. */ @@ -2149,6 +2151,7 @@ cmd_buffer_gfx_state_emission(struct anv_cmd_buffer *cmd_buffer) INIT(blend, AlphaToCoverageEnable), INIT(blend, AlphaToOneEnable), INIT(blend, IndependentAlphaBlendEnable), + INIT(blend, ColorDitherEnable), }; GENX(BLEND_STATE_pack)(NULL, dws, &blend_state); |