diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 6e7a45c..c794cc4 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -4284,6 +4284,7 @@ static void *emit_image_decl(const struct dump_ctx *ctx, char *glsl_hdr, const char *sname, *stc, *formatstr; enum tgsi_return_type itype; const char *volatile_str = image->vflag ? "volatile " : ""; + const char *precision = ctx->cfg->use_gles ? "highp " : ""; const char *access = ""; formatstr = get_internalformat_string(image->decl.Format, &itype); ptc = vrend_shader_samplerreturnconv(itype); @@ -4305,11 +4306,11 @@ static void *emit_image_decl(const struct dump_ctx *ctx, char *glsl_hdr, } if (range) - snprintf(buf, 255, "%s%suniform %cimage%s %simg%d[%d];\n", - access, volatile_str, ptc, stc, sname, i, range); + snprintf(buf, 255, "%s%suniform %s%cimage%s %simg%d[%d];\n", + access, volatile_str, precision, ptc, stc, sname, i, range); else - snprintf(buf, 255, "%s%suniform %cimage%s %simg%d;\n", - access, volatile_str, ptc, stc, sname, i); + snprintf(buf, 255, "%s%suniform %s%cimage%s %simg%d;\n", + access, volatile_str, precision, ptc, stc, sname, i); STRCAT_WITH_RET(glsl_hdr, buf); return glsl_hdr;