Mesa (master): lavapipe: interpret inputRate as an enum-value
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Dec 10 01:12:35 UTC 2020
Module: Mesa
Branch: master
Commit: 5b0b03733a4fdc5b9cd485bd313810b37c81b2a9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b0b03733a4fdc5b9cd485bd313810b37c81b2a9
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Fri Dec 4 19:45:00 2020 +0100
lavapipe: interpret inputRate as an enum-value
This isn't an integer, it's an enum, We need to support
VK_EXT_vertex_attribute_divisor if we want to support using values other
than 0 and 1 here.
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7930>
---
src/gallium/frontends/lavapipe/lvp_execute.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c
index 41af4ac4763..f7a6aa12577 100644
--- a/src/gallium/frontends/lavapipe/lvp_execute.c
+++ b/src/gallium/frontends/lavapipe/lvp_execute.c
@@ -574,7 +574,18 @@ static void handle_graphics_pipeline(struct lvp_cmd_buffer_entry *cmd,
state->ve[location].src_offset = vi->pVertexAttributeDescriptions[i].offset;
state->ve[location].vertex_buffer_index = vi->pVertexAttributeDescriptions[i].binding;
state->ve[location].src_format = vk_format_to_pipe(vi->pVertexAttributeDescriptions[i].format);
- state->ve[location].instance_divisor = vi->pVertexBindingDescriptions[vi->pVertexAttributeDescriptions[i].binding].inputRate;
+
+ switch (vi->pVertexBindingDescriptions[vi->pVertexAttributeDescriptions[i].binding].inputRate) {
+ case VK_VERTEX_INPUT_RATE_VERTEX:
+ state->ve[location].instance_divisor = 0;
+ break;
+ case VK_VERTEX_INPUT_RATE_INSTANCE:
+ state->ve[location].instance_divisor = 1;
+ break;
+ default:
+ assert(0);
+ break;
+ }
if ((int)location > max_location)
max_location = location;
More information about the mesa-commit
mailing list