shader: add missing precision specifier

In GLES, these need a precision specifier, otherwise we get
compile errors.

This fixes a shader-compile error on OpenGL ES 3.1.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent b6cbb42afe
commit 2d6249846d
  1. 2
      src/vrend_shader.c

@ -4126,7 +4126,7 @@ static void *emit_sampler_decl(struct dump_ctx *ctx, char *glsl_hdr, uint32_t i,
/* GLES does not support 1D textures -- we use a 2D texture and set the parameter set to 0.5 */ /* GLES does not support 1D textures -- we use a 2D texture and set the parameter set to 0.5 */
if (ctx->cfg->use_gles && texture_type == TGSI_TEXTURE_1D) if (ctx->cfg->use_gles && texture_type == TGSI_TEXTURE_1D)
snprintf(buf, 255, "uniform %csampler2D %ssamp%d;\n", ptc, sname, i); snprintf(buf, 255, "uniform highp %csampler2D %ssamp%d;\n", ptc, sname, i);
else if (range) else if (range)
snprintf(buf, 255, "uniform %s%csampler%s %ssamp%d[%d];\n", precision, ptc, stc, sname, i, range); snprintf(buf, 255, "uniform %s%csampler%s %ssamp%d[%d];\n", precision, ptc, stc, sname, i, range);
else else

Loading…
Cancel
Save