#define VC4_DIRTY_INDEXBUF (1 << 16)
#define VC4_DIRTY_SCISSOR (1 << 17)
#define VC4_DIRTY_FLAT_SHADE_FLAGS (1 << 18)
+#define VC4_DIRTY_PRIM_MODE (1 << 19)
#define VC4_SHADER_DIRTY_VP (1 << 0)
#define VC4_SHADER_DIRTY_FP (1 << 1)
unsigned int reg_class_any;
unsigned int reg_class_a;
+ uint8_t prim_mode;
+
/** @{ Current pipeline state objects */
struct pipe_scissor_state scissor;
struct pipe_blend_state *blend;
struct vc4_vertex_stateobj *vtx = vc4->vtx;
struct vc4_vertexbuf_stateobj *vertexbuf = &vc4->vertexbuf;
+ if (vc4->prim_mode != info->mode) {
+ vc4->prim_mode = info->mode;
+ vc4->dirty |= VC4_DIRTY_PRIM_MODE;
+ }
+
vc4_start_draw(vc4);
vc4_update_compiled_shaders(vc4, info->mode);
struct vc4_fs_key local_key;
struct vc4_fs_key *key = &local_key;
+ if (!(vc4->dirty & (VC4_DIRTY_PRIM_MODE |
+ VC4_DIRTY_BLEND |
+ VC4_DIRTY_FRAMEBUFFER |
+ VC4_DIRTY_ZSA |
+ VC4_DIRTY_RASTERIZER |
+ VC4_DIRTY_FRAGTEX |
+ VC4_DIRTY_TEXSTATE |
+ VC4_DIRTY_PROG))) {
+ return;
+ }
+
memset(key, 0, sizeof(*key));
vc4_setup_shared_key(&key->base, &vc4->fragtex);
key->base.shader_state = vc4->prog.bind_fs;
struct vc4_vs_key local_key;
struct vc4_vs_key *key = &local_key;
+ if (!(vc4->dirty & (VC4_DIRTY_PRIM_MODE |
+ VC4_DIRTY_RASTERIZER |
+ VC4_DIRTY_VERTTEX |
+ VC4_DIRTY_TEXSTATE |
+ VC4_DIRTY_VTXSTATE |
+ VC4_DIRTY_PROG))) {
+ return;
+ }
+
memset(key, 0, sizeof(*key));
vc4_setup_shared_key(&key->base, &vc4->verttex);
key->base.shader_state = vc4->prog.bind_vs;