zink: round out handling for streamout buffer stride setting during draw
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 14 Oct 2020 14:40:14 +0000 (10:40 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 16 Oct 2020 13:15:30 +0000 (09:15 -0400)
this adds cases for tess and geometry shaders in the xfb path for grabbing
stride off the shader

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7139>

src/gallium/drivers/zink/zink_draw.c

index 858718e..0dd24d0 100644 (file)
@@ -299,7 +299,10 @@ zink_draw_vbo(struct pipe_context *pctx,
       if (!shader)
          continue;
 
-      if (i == MESA_SHADER_VERTEX && ctx->num_so_targets) {
+      if (ctx->num_so_targets &&
+          (i == PIPE_SHADER_GEOMETRY ||
+          (i == PIPE_SHADER_TESS_EVAL && !ctx->gfx_stages[PIPE_SHADER_GEOMETRY]) ||
+          (i == PIPE_SHADER_VERTEX && !ctx->gfx_stages[PIPE_SHADER_GEOMETRY] && !ctx->gfx_stages[PIPE_SHADER_TESS_EVAL]))) {
          for (unsigned i = 0; i < ctx->num_so_targets; i++) {
             struct zink_so_target *t = zink_so_target(ctx->so_targets[i]);
             t->stride = shader->streamout.so_info.stride[i] * sizeof(uint32_t);