diff options
author | Iván Briano <ivan.briano@intel.com> | 2024-05-01 11:43:40 -0700 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2024-05-07 16:54:10 +0200 |
commit | aad74e3c738a281fa0e8ab9821fa1dcc88d61673 (patch) | |
tree | c1e70b535a1cdc425d5c0687ac9d901d9f109d08 | |
parent | bf737eef0b84f7e87787d10feb62c067ff8ddd38 (diff) |
anv: fix casting to graphics_pipeline_base
The macro takes the type of the pipeline to check for, but the cast to
base checks for a full graphics pipeline, so if used on a library one it
fails.
Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29011>
(cherry picked from commit 6223388c738e37a6d509ba54e2d179ee5773a4d6)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/intel/vulkan/anv_pipeline.c | 2 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 10 |
3 files changed, 11 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index 8fc2b0350e0..c136376337a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -804,7 +804,7 @@ "description": "anv: fix casting to graphics_pipeline_base", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index fcf57756c3a..7d3c974254e 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -4252,7 +4252,7 @@ VkResult anv_GetPipelineExecutableStatisticsKHR( switch (pipeline->type) { case ANV_PIPELINE_GRAPHICS: case ANV_PIPELINE_GRAPHICS_LIB: { - prog_data = anv_pipeline_to_graphics(pipeline)->base.shaders[exe->stage]->prog_data; + prog_data = anv_pipeline_to_graphics_base(pipeline)->shaders[exe->stage]->prog_data; break; } case ANV_PIPELINE_COMPUTE: { diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index b0c728b1a06..cb87ebe5f80 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -4372,11 +4372,19 @@ struct anv_ray_tracing_pipeline { } ANV_DECL_PIPELINE_DOWNCAST(graphics, ANV_PIPELINE_GRAPHICS) -ANV_DECL_PIPELINE_DOWNCAST(graphics_base, ANV_PIPELINE_GRAPHICS) ANV_DECL_PIPELINE_DOWNCAST(graphics_lib, ANV_PIPELINE_GRAPHICS_LIB) ANV_DECL_PIPELINE_DOWNCAST(compute, ANV_PIPELINE_COMPUTE) ANV_DECL_PIPELINE_DOWNCAST(ray_tracing, ANV_PIPELINE_RAY_TRACING) +/* Can't use the macro because we need to handle both types. */ +static inline struct anv_graphics_base_pipeline * +anv_pipeline_to_graphics_base(struct anv_pipeline *pipeline) +{ + assert(pipeline->type == ANV_PIPELINE_GRAPHICS || + pipeline->type == ANV_PIPELINE_GRAPHICS_LIB); + return (struct anv_graphics_base_pipeline *) pipeline; +} + static inline bool anv_pipeline_has_stage(const struct anv_graphics_pipeline *pipeline, gl_shader_stage stage) |