freedreno/a6xx: Only set emit.hs/ds when we're drawing patches
authorKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:32:24 +0000 (16:32 -0800)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:40:27 +0000 (16:40 -0800)
At least the gallium blitter helper will call us to draw with
tessellation shaders set but a non-patch primitive.

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index 4a36b7e7c9a9d6888f267760c690088e1d29c710..37ff241f2b175fcbe6936c9b401af1f036a3e52d 100644 (file)
@@ -129,8 +129,6 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
                .info = info,
                .key = {
                        .vs = ctx->prog.vs,
-                       .hs = ctx->prog.hs,
-                       .ds = ctx->prog.ds,
                        .gs = ctx->prog.gs,
                        .fs = ctx->prog.fs,
                        .key = {
@@ -158,6 +156,9 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
        };
 
        if (info->mode == PIPE_PRIM_PATCHES) {
+               emit.key.hs = ctx->prog.hs;
+               emit.key.ds = ctx->prog.ds;
+
                shader_info *ds_info = &emit.key.ds->nir->info;
                switch (ds_info->tess.primitive_mode) {
                case GL_ISOLINES: