zink/spirv: implement point-sprites
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 12 Nov 2018 12:20:15 +0000 (13:20 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:43 +0000 (08:51 +0000)
This passes glsl-fs-pointcoord_gles2 from piglit.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_screen.c

index 56f5628aa5f755b583966862b27f46ade5c566c7..166bdf2994913ff92d3b299d075cca97b4b43b10 100644 (file)
@@ -134,6 +134,10 @@ emit_input(struct ntv_context *ctx, struct nir_variable *var)
          spirv_builder_emit_builtin(&ctx->builder, var_id, SpvBuiltInFragCoord);
          break;
 
+      case VARYING_SLOT_PNTC:
+         spirv_builder_emit_builtin(&ctx->builder, var_id, SpvBuiltInPointCoord);
+         break;
+
       default:
          spirv_builder_emit_location(&ctx->builder, var_id,
                                      var->data.driver_location);
index dd1d304b67bc062ffb2e0280e0c872920f0d1368..5f8bbfd9f058dc00d777db7cf128fcefe5550bed 100644 (file)
@@ -96,6 +96,9 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
       return screen->props.limits.maxFragmentDualSrcAttachments;
 
+   case PIPE_CAP_POINT_SPRITE:
+      return 1;
+
    case PIPE_CAP_MAX_RENDER_TARGETS:
       return screen->props.limits.maxColorAttachments;