shader: Enable tesselation_point_size extension for all tesselation shaders

The vertex shader always gl_PerVertex, but the tesselation shaders only
define the structure when the point size extension is enabled, otherwise
gl_PointSize is passed as a generic varying and can not be written to.

If one enables the extension based on whether the value gl_PointSize is
actually accessed in the tess shaders then it might happend that tess_ctrl
doesn't touch the value, and the extension isn't enabled, and tess_eval
accesses it and the extension is enabled. In such a case gl_PointSize is
passed as a generic to and from the tess_ctrl shader and linking of the
shaders will fail because of different definitions of gl_PerVertex.

Since in this case there is no indication in the tess_ctrl shader that
point_size is accessed, and it is not known whether the shader will be
linked with a tess_eval shader that uses gl_PointSize the workaround is to
always enable the extension for all tesselation shaders.

Fixes:
  dEQP-GLES31.functional.tessellation_geometry_interaction.
    point_size.evaluation_set
    point_size.vertex_set_control_set
    point_size.vertex_set_evaluation_set
    point_size.vertex_set_evaluation_set_geometry_default

  dEQP-GLES31.functional.primitive_bounding_box.wide_points.
    global_state.vertex_tessellation_fragment.
      default_framebuffer_bbox_equal
      default_framebuffer_bbox_larger
      default_framebuffer_bbox_smaller
      fbo_bbox_equal
      fbo_bbox_larger
      fbo_bbox_smaller

  dEQP-GLES31.functional.primitive_bounding_box.wide_points.
    tessellation_set_per_draw.vertex_tessellation_fragment.
      default_framebuffer_bbox_equal
      default_framebuffer_bbox_equal
      default_framebuffer_bbox_larger
      default_framebuffer_bbox_smaller
      fbo_bbox_equal
      fbo_bbox_larger
      fbo_bbox_smaller
    tessellation_set_per_primitive.vertex_tessellation_fragment.
      default_framebuffer
      fragment.fbo

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent ab34c9d782
commit 19cef6be4a
  1. 1
      src/vrend_shader.c

@ -4000,6 +4000,7 @@ static char *emit_header(struct dump_ctx *ctx, char *glsl_hdr)
ctx->prog_type == TGSI_PROCESSOR_TESS_EVAL)) { ctx->prog_type == TGSI_PROCESSOR_TESS_EVAL)) {
if (ctx->cfg->glsl_version < 320) if (ctx->cfg->glsl_version < 320)
STRCAT_WITH_RET(glsl_hdr, "#extension GL_OES_tessellation_shader : require\n"); STRCAT_WITH_RET(glsl_hdr, "#extension GL_OES_tessellation_shader : require\n");
STRCAT_WITH_RET(glsl_hdr, "#extension GL_OES_tessellation_point_size : enable\n");
} }
PAD_GPU_SHADER5(glsl_hdr); PAD_GPU_SHADER5(glsl_hdr);

Loading…
Cancel
Save