diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index a325f9e..2103f66 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -2804,6 +2804,7 @@ static inline void vrend_fill_shader_key(struct vrend_context *ctx, } key->invert_fs_origin = !ctx->sub->inverted_fbo_content; key->coord_replace = ctx->sub->rs_state.point_quad_rasterization ? ctx->sub->rs_state.sprite_coord_enable : 0; + key->winsys_adjust_y_emitted = false; if (ctx->sub->shaders[PIPE_SHADER_GEOMETRY]) key->gs_present = true; diff --git a/src/vrend_shader.c b/src/vrend_shader.c index a3e3b01..08053b9 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -4613,8 +4613,10 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr) } if (ctx->prog_type == TGSI_PROCESSOR_FRAGMENT && ctx->cfg->use_gles && + !ctx->key->winsys_adjust_y_emitted && (ctx->key->coord_replace & (1 << ctx->inputs[i].sid))) { snprintf(buf, 255, "uniform float winsys_adjust_y;\n"); + ctx->key->winsys_adjust_y_emitted = true; STRCAT_WITH_RET(glsl_hdr, buf); } } diff --git a/src/vrend_shader.h b/src/vrend_shader.h index fbcdf63..cb928e6 100644 --- a/src/vrend_shader.h +++ b/src/vrend_shader.h @@ -82,6 +82,7 @@ struct vrend_shader_info { struct vrend_shader_key { uint32_t coord_replace; + bool winsys_adjust_y_emitted; bool invert_fs_origin; bool pstipple_tex; bool add_alpha_test;