From 2f5686e212442f5612353031eb87dd2d2a89de14 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 4 May 2026 15:08:38 -0400 Subject: [PATCH] i915: pass NIR to draw instead of pre-converted TGSI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit draw_vs.c already handles the non-native-integer NIR→TGSI conversion internally, so i915 doesn't need to do it. keep nir_lower_point_size (i915-specific lowering) and pass the result to draw as NIR. Assisted-by: Claude --- src/gallium/drivers/i915/i915_state.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 8d786c02e41..af45247355d 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -667,28 +667,11 @@ i915_create_vs_state(struct pipe_context *pipe, const struct pipe_shader_state *templ) { struct i915_context *i915 = i915_context(pipe); - void *vertex_shader; - struct pipe_shader_state from_nir = {PIPE_SHADER_IR_TGSI}; - if (templ->type == PIPE_SHADER_IR_NIR) { - nir_shader *s = templ->ir.nir; + if (templ->type == PIPE_SHADER_IR_NIR) + NIR_PASS(_, templ->ir.nir, nir_lower_point_size, 1.0, 255.0); - NIR_PASS(_, s, nir_lower_point_size, 1.0, 255.0); - - /* The gallivm draw path doesn't support non-native-integers NIR shaders, - * st/mesa does native-integers for the screen as a whole rather than - * per-stage, and i915 FS can't do native integers. So, convert to TGSI, - * where the draw path *does* support non-native-integers. - */ - from_nir.tokens = nir_to_tgsi(s, pipe->screen); - templ = &from_nir; - } - - vertex_shader = draw_create_vertex_shader(i915->draw, templ); - - FREE((void *)from_nir.tokens); - - return vertex_shader; + return draw_create_vertex_shader(i915->draw, templ); } static void