Mesa (main): zink: hook up line-rasterization ext
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 9 13:36:43 UTC 2021
Module: Mesa
Branch: main
Commit: 9e7e54b4738df04dce385006d0d8ce1314c9e319
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e7e54b4738df04dce385006d0d8ce1314c9e319
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Mon Oct 28 16:42:48 2019 +0100
zink: hook up line-rasterization ext
The VK_EXT_line_rasterization extension allows to specify the
correct line-rasterization rules, which is needed for correct OpenGL
rendering.
So, let's prepare for filling this one out. Right now, it does a whole
lot of nothing, but that's about to change.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11795>
---
src/gallium/drivers/zink/zink_device_info.py | 4 ++++
src/gallium/drivers/zink/zink_pipeline.c | 11 +++++++++++
2 files changed, 15 insertions(+)
diff --git a/src/gallium/drivers/zink/zink_device_info.py b/src/gallium/drivers/zink/zink_device_info.py
index 556b7a3310a..a32eb3346eb 100644
--- a/src/gallium/drivers/zink/zink_device_info.py
+++ b/src/gallium/drivers/zink/zink_device_info.py
@@ -171,6 +171,10 @@ EXTENSIONS = [
properties=True),
Extension("VK_KHR_descriptor_update_template",
alias="template"),
+ Extension("VK_EXT_line_rasterization",
+ alias="line_rast",
+ properties=True,
+ features=True),
]
# constructor: Versions(device_version(major, minor, patch), struct_version(major, minor))
diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c
index f0896581059..c9a01b215fa 100644
--- a/src/gallium/drivers/zink/zink_pipeline.c
+++ b/src/gallium/drivers/zink/zink_pipeline.c
@@ -145,6 +145,17 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
rast_state.pNext = &pv_state;
}
+ VkPipelineRasterizationLineStateCreateInfoEXT rast_line_state;
+ if (screen->info.have_EXT_line_rasterization) {
+ rast_line_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT;
+ rast_line_state.pNext = rast_state.pNext;
+ rast_line_state.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT;
+ rast_line_state.stippledLineEnable = VK_FALSE;
+ rast_line_state.lineStippleFactor = 0;
+ rast_line_state.lineStipplePattern = 0;
+ rast_state.pNext = &rast_line_state;
+ }
+
VkPipelineDepthStencilStateCreateInfo depth_stencil_state = {0};
depth_stencil_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
depth_stencil_state.depthTestEnable = state->depth_stencil_alpha_state->depth_test;
More information about the mesa-commit
mailing list