Module: Mesa
Branch: main
Commit: 001779a33d80861d4bdabc3d0c7c78f75dee113f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=001779a33d80861d4bdabc3d0c7c78f75dee113f

Author: Konstantin Seurer <[email protected]>
Date:   Sun Aug  7 20:13:10 2022 +0200

lavapipe: Remove st_shader_stage_to_ptarget

Signed-off-by: Konstantin Seurer <[email protected]>
Reviewed-By: Mike Blumenkrantz <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17930>

---

 src/gallium/frontends/lavapipe/lvp_pipeline.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c 
b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index b9a12a3ec65..5255584c21b 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -88,30 +88,6 @@ VKAPI_ATTR void VKAPI_CALL lvp_DestroyPipeline(
    simple_mtx_unlock(&device->queue.pipeline_lock);
 }
 
-static inline unsigned
-st_shader_stage_to_ptarget(gl_shader_stage stage)
-{
-   switch (stage) {
-   case MESA_SHADER_VERTEX:
-      return PIPE_SHADER_VERTEX;
-   case MESA_SHADER_FRAGMENT:
-      return PIPE_SHADER_FRAGMENT;
-   case MESA_SHADER_GEOMETRY:
-      return PIPE_SHADER_GEOMETRY;
-   case MESA_SHADER_TESS_CTRL:
-      return PIPE_SHADER_TESS_CTRL;
-   case MESA_SHADER_TESS_EVAL:
-      return PIPE_SHADER_TESS_EVAL;
-   case MESA_SHADER_COMPUTE:
-      return PIPE_SHADER_COMPUTE;
-   default:
-      break;
-   }
-
-   assert(!"should not be reached");
-   return PIPE_SHADER_VERTEX;
-}
-
 static void
 shared_var_info(const struct glsl_type *type, unsigned *size, unsigned *align)
 {
@@ -385,7 +361,8 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
 {
    struct lvp_device *pdevice = pipeline->device;
    gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage);
-   const nir_shader_compiler_options *drv_options = 
pdevice->pscreen->get_compiler_options(pipeline->device->pscreen, 
PIPE_SHADER_IR_NIR, st_shader_stage_to_ptarget(stage));
+   assert(stage <= MESA_SHADER_COMPUTE && stage != MESA_SHADER_NONE);
+   const nir_shader_compiler_options *drv_options = 
pdevice->pscreen->get_compiler_options(pipeline->device->pscreen, 
PIPE_SHADER_IR_NIR, (enum pipe_shader_type)stage);
    VkResult result;
    nir_shader *nir;
 

Reply via email to