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

Author: Alyssa Rosenzweig <aly...@rosenzweig.io>
Date:   Sat Nov 18 22:11:52 2023 -0400

v3d: use pipe_shader_from_nir

Signed-off-by: Alyssa Rosenzweig <aly...@rosenzweig.io>
Reviewed-by: Eric Engestrom <e...@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>

---

 src/gallium/drivers/v3d/v3d_blit.c | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/v3d/v3d_blit.c 
b/src/gallium/drivers/v3d/v3d_blit.c
index 32030a7b4e1..7cad3762dd1 100644
--- a/src/gallium/drivers/v3d/v3d_blit.c
+++ b/src/gallium/drivers/v3d/v3d_blit.c
@@ -21,6 +21,7 @@
  * IN THE SOFTWARE.
  */
 
+#include "nir/pipe_nir.h"
 #include "util/format/u_format.h"
 #include "util/u_surface.h"
 #include "util/u_blitter.h"
@@ -476,12 +477,7 @@ v3d_get_sand8_vs(struct pipe_context *pctx)
         pos_out->data.location = VARYING_SLOT_POS;
         nir_store_var(&b, pos_out, nir_load_var(&b, pos_in), 0xf);
 
-        struct pipe_shader_state shader_tmpl = {
-                .type = PIPE_SHADER_IR_NIR,
-                .ir.nir = b.shader,
-        };
-
-        v3d->sand8_blit_vs = pctx->create_vs_state(pctx, &shader_tmpl);
+        v3d->sand8_blit_vs = pipe_shader_from_nir(pctx, b.shader);
 
         return v3d->sand8_blit_vs;
 }
@@ -621,12 +617,8 @@ v3d_get_sand8_fs(struct pipe_context *pctx, int cpp)
                       output,
                       0xF);
 
-        struct pipe_shader_state shader_tmpl = {
-                .type = PIPE_SHADER_IR_NIR,
-                .ir.nir = b.shader,
-        };
 
-        *cached_shader = pctx->create_fs_state(pctx, &shader_tmpl);
+        *cached_shader = pipe_shader_from_nir(pctx, b.shader);
 
         return *cached_shader;
 }
@@ -769,12 +761,7 @@ v3d_get_sand30_vs(struct pipe_context *pctx)
         pos_out->data.location = VARYING_SLOT_POS;
         nir_store_var(&b, pos_out, nir_load_var(&b, pos_in), 0xf);
 
-        struct pipe_shader_state shader_tmpl = {
-                .type = PIPE_SHADER_IR_NIR,
-                .ir.nir = b.shader,
-        };
-
-        v3d->sand30_blit_vs = pctx->create_vs_state(pctx, &shader_tmpl);
+        v3d->sand30_blit_vs = pipe_shader_from_nir(pctx, b.shader);
 
         return v3d->sand30_blit_vs;
 }
@@ -948,12 +935,8 @@ v3d_get_sand30_fs(struct pipe_context *pctx)
         nir_store_var(&b, color_out,
                       output,
                       0xf);
-        struct pipe_shader_state shader_tmpl = {
-                .type = PIPE_SHADER_IR_NIR,
-                .ir.nir = b.shader,
-        };
 
-        v3d->sand30_blit_fs = pctx->create_fs_state(pctx, &shader_tmpl);
+        v3d->sand30_blit_fs = pipe_shader_from_nir(pctx, b.shader);
 
         return v3d->sand30_blit_fs;
 }

Reply via email to