diff --git a/src/compiler/nir/nir_lower_passthrough_edgeflags.c b/src/compiler/nir/nir_lower_passthrough_edgeflags.c index 1fd2cd20014..e6d0b14f26b 100644 --- a/src/compiler/nir/nir_lower_passthrough_edgeflags.c +++ b/src/compiler/nir/nir_lower_passthrough_edgeflags.c @@ -96,5 +96,9 @@ lower_impl(nir_function_impl *impl) void nir_lower_passthrough_edgeflags(nir_shader *shader) { + assert(shader->info.stage == MESA_SHADER_VERTEX); + + shader->info.vs.needs_edge_flag = true; + lower_impl(nir_shader_get_entrypoint(shader)); } diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index b3aabb9f054..91421db9b74 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -297,6 +297,9 @@ typedef struct shader_info { /* True if the shader writes position in window space coordinates pre-transform */ bool window_space_position:1; + + /** Is an edge flag input needed? */ + bool needs_edge_flag:1; } vs; struct { diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 840a5cb28d4..858294ad2d9 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -2441,6 +2441,7 @@ iris_create_uncompiled_shader(struct iris_screen *screen, simple_mtx_init(&ish->lock, mtx_plain); NIR_PASS(ish->needs_edge_flag, nir, iris_fix_edge_flags); + assert(ish->needs_edge_flag == nir->info.vs.needs_edge_flag); brw_preprocess_nir(screen->compiler, nir, NULL);