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

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

vc4: 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/vc4/vc4_blit.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_blit.c 
b/src/gallium/drivers/vc4/vc4_blit.c
index 1434c9cb891..0e885d180c5 100644
--- a/src/gallium/drivers/vc4/vc4_blit.c
+++ b/src/gallium/drivers/vc4/vc4_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"
@@ -239,12 +240,7 @@ static void *vc4_get_yuv_vs(struct pipe_context *pctx)
 
    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,
-   };
-
-   vc4->yuv_linear_blit_vs = pctx->create_vs_state(pctx, &shader_tmpl);
+   vc4->yuv_linear_blit_vs = pipe_shader_from_nir(pctx, b.shader);
 
    return vc4->yuv_linear_blit_vs;
 }
@@ -329,12 +325,7 @@ static void *vc4_get_yuv_fs(struct pipe_context *pctx, int 
cpp)
                  nir_unpack_unorm_4x8(&b, load),
                  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;
 }

Reply via email to