zink: store prim mode to context during draw
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 17 Feb 2021 14:51:43 +0000 (09:51 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 24 Feb 2021 23:25:01 +0000 (23:25 +0000)
we need to be able to access this for shader rewrites

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9115>

src/gallium/drivers/zink/zink_context.h
src/gallium/drivers/zink/zink_draw.c

index 0b1b3c9..9b5868e 100644 (file)
@@ -132,6 +132,7 @@ struct zink_context {
 
    struct zink_shader *gfx_stages[ZINK_SHADER_COUNT];
    struct zink_gfx_pipeline_state gfx_pipeline_state;
+   enum pipe_prim_type gfx_prim_mode;
    struct hash_table *program_cache;
    struct zink_gfx_program *curr_program;
 
index 70d1fd6..76e3d18 100644 (file)
@@ -664,6 +664,7 @@ zink_draw_vbo(struct pipe_context *pctx,
    if (drawid_broken != ctx->drawid_broken)
       ctx->dirty_shader_stages |= BITFIELD_BIT(PIPE_SHADER_VERTEX);
    ctx->gfx_pipeline_state.vertices_per_patch = dinfo->vertices_per_patch;
+   ctx->gfx_prim_mode = dinfo->mode;
    struct zink_gfx_program *gfx_program = get_gfx_program(ctx);
    if (!gfx_program)
       return;