Mesa (main): v3dv: define a generic helper to create binning pipeline stages
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 12 07:56:02 UTC 2021
Module: Mesa
Branch: main
Commit: 9803336016ba73ece3cbf423590873c743632491
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9803336016ba73ece3cbf423590873c743632491
Author: Iago Toral Quiroga <itoral at igalia.com>
Date: Wed Jun 30 10:12:30 2021 +0200
v3dv: define a generic helper to create binning pipeline stages
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11783>
---
src/broadcom/vulkan/v3dv_pipeline.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c
index 07cdf26d278..90c33a66e68 100644
--- a/src/broadcom/vulkan/v3dv_pipeline.c
+++ b/src/broadcom/vulkan/v3dv_pipeline.c
@@ -1277,16 +1277,16 @@ pipeline_populate_v3d_vs_key(struct v3d_vs_key *key,
}
}
-/*
- * Creates the pipeline_stage for the coordinate shader. Initially a clone of
- * the vs pipeline_stage, with is_coord to true
+/**
+ * Creates the initial form of the pipeline stage for a binning shader by
+ * cloning the render shader and flagging it as a coordinate shader.
*
* Returns NULL if it was not able to allocate the object, so it should be
* handled as a VK_ERROR_OUT_OF_HOST_MEMORY error.
*/
-static struct v3dv_pipeline_stage*
-pipeline_stage_create_vs_bin(const struct v3dv_pipeline_stage *src,
- const VkAllocationCallbacks *pAllocator)
+static struct v3dv_pipeline_stage *
+pipeline_stage_create_binning(const struct v3dv_pipeline_stage *src,
+ const VkAllocationCallbacks *pAllocator)
{
struct v3dv_device *device = src->pipeline->device;
@@ -1297,9 +1297,16 @@ pipeline_stage_create_vs_bin(const struct v3dv_pipeline_stage *src,
if (p_stage == NULL)
return NULL;
+ assert(src->stage == BROADCOM_SHADER_VERTEX ||
+ src->stage == BROADCOM_SHADER_GEOMETRY);
+
+ enum broadcom_shader_stage bin_stage =
+ src->stage == BROADCOM_SHADER_VERTEX ?
+ BROADCOM_SHADER_VERTEX_BIN :
+ BROADCOM_SHADER_GEOMETRY_BIN;
+
p_stage->pipeline = src->pipeline;
- assert(src->stage == BROADCOM_SHADER_VERTEX);
- p_stage->stage = BROADCOM_SHADER_VERTEX_BIN;
+ p_stage->stage = bin_stage;
p_stage->entrypoint = src->entrypoint;
p_stage->module = src->module;
p_stage->nir = src->nir ? nir_shader_clone(NULL, src->nir) : NULL;
@@ -2043,7 +2050,7 @@ pipeline_compile_graphics(struct v3dv_pipeline *pipeline,
case MESA_SHADER_VERTEX:
pipeline->vs = p_stage;
pipeline->vs_bin =
- pipeline_stage_create_vs_bin(pipeline->vs, pAllocator);
+ pipeline_stage_create_binning(pipeline->vs, pAllocator);
if (pipeline->vs_bin == NULL)
return VK_ERROR_OUT_OF_HOST_MEMORY;
More information about the mesa-commit
mailing list