Mesa (main): anv: centralize vk_to_intel_logic_op array
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 4 13:16:30 UTC 2021
Module: Mesa
Branch: main
Commit: e0c60553512e8ba6cd1d0413025c96aece23b929
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0c60553512e8ba6cd1d0413025c96aece23b929
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Mon May 3 11:11:24 2021 +0300
anv: centralize vk_to_intel_logic_op array
This avoids multiple copies as we will need this in multiple places.
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10366>
---
src/intel/vulkan/anv_genX.h | 2 ++
src/intel/vulkan/genX_pipeline.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/intel/vulkan/anv_genX.h b/src/intel/vulkan/anv_genX.h
index 7a4fe834648..3f7aa7eaba2 100644
--- a/src/intel/vulkan/anv_genX.h
+++ b/src/intel/vulkan/anv_genX.h
@@ -46,6 +46,8 @@ extern const uint32_t genX(vk_to_intel_compare_op)[];
extern const uint32_t genX(vk_to_intel_stencil_op)[];
+extern const uint32_t genX(vk_to_intel_logic_op)[];
+
void genX(init_physical_device_state)(struct anv_physical_device *device);
VkResult genX(init_device_state)(struct anv_device *device);
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index ee7e336fec2..f3bda16ff01 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -857,7 +857,7 @@ emit_ms_state(struct anv_graphics_pipeline *pipeline,
#endif
}
-static const uint32_t vk_to_intel_logic_op[] = {
+const uint32_t genX(vk_to_intel_logic_op)[] = {
[VK_LOGIC_OP_COPY] = LOGICOP_COPY,
[VK_LOGIC_OP_CLEAR] = LOGICOP_CLEAR,
[VK_LOGIC_OP_AND] = LOGICOP_AND,
@@ -1263,7 +1263,7 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
.AlphaToOneEnable = ms_info && ms_info->alphaToOneEnable,
#endif
.LogicOpEnable = info->logicOpEnable,
- .LogicOpFunction = vk_to_intel_logic_op[info->logicOp],
+ .LogicOpFunction = genX(vk_to_intel_logic_op)[info->logicOp],
/* Vulkan specification 1.2.168, VkLogicOp:
*
* "Logical operations are controlled by the logicOpEnable and
More information about the mesa-commit
mailing list