shader: Invert y coordonate if on gles host

OpenGL ES didn't support GL_POINT_SPRITE_COORD_ORIGIN.
So when we read from a fbo, the image is upside down.
This is because the guest renders into a window drawable
which is inverted, while the host renders into a FBO.
This patch inverts the y coordinate.

Fixes: dEQP-GLES2.functional.shaders.builtin_variable.pointcoord

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Elie Tournier 7 years ago committed by Jakob Bornecrantz
parent 78c9c237b0
commit 7f615cdee1
  1. 3
      src/vrend_shader.c

@ -415,6 +415,9 @@ iter_declaration(struct tgsi_iterate_context *iter,
case TGSI_SEMANTIC_GENERIC: case TGSI_SEMANTIC_GENERIC:
if (iter->processor.Processor == TGSI_PROCESSOR_FRAGMENT) { if (iter->processor.Processor == TGSI_PROCESSOR_FRAGMENT) {
if (ctx->key->coord_replace & (1 << ctx->inputs[i].sid)) { if (ctx->key->coord_replace & (1 << ctx->inputs[i].sid)) {
if (ctx->cfg->use_gles)
name_prefix = "vec4(gl_PointCoord.x, 1.0 - gl_PointCoord.y, 0.0, 1.0)";
else
name_prefix = "vec4(gl_PointCoord, 0.0, 1.0)"; name_prefix = "vec4(gl_PointCoord, 0.0, 1.0)";
ctx->inputs[i].glsl_predefined_no_emit = true; ctx->inputs[i].glsl_predefined_no_emit = true;
ctx->inputs[i].glsl_no_index = true; ctx->inputs[i].glsl_no_index = true;

Loading…
Cancel
Save