#define IRIS_DIRTY_SO_DECL_LIST (1ull << 49)
#define IRIS_DIRTY_STREAMOUT (1ull << 50)
+/**
+ * Non-orthogonal state (NOS) dependency flags.
+ *
+ * Shader programs may depend on non-orthogonal state. These flags are
+ * used to indicate that a shader's key depends on the state provided by
+ * a certain Gallium CSO.
+ */
+enum iris_nos_dep {
+ IRIS_NOS_FRAMEBUFFER,
+ IRIS_NOS_DEPTH_STENCIL_ALPHA,
+ IRIS_NOS_RASTERIZER,
+ IRIS_NOS_BLEND,
+
+ IRIS_NOS_COUNT,
+};
+
struct iris_depth_stencil_alpha_state;
enum iris_program_cache_id {
struct {
uint64_t dirty;
+ uint64_t dirty_for_nos[IRIS_NOS_COUNT];
unsigned num_viewports;
unsigned sample_mask;
struct iris_blend_state *cso_blend;
struct iris_uncompiled_shader {
struct pipe_shader_state base;
unsigned program_id;
+
+ /** Bitfield of (1 << IRIS_NOS_*) flags. */
+ unsigned nos;
};
// XXX: need unify_interfaces() at link time...
ice->shaders.uncompiled[stage] = ish;
ice->state.dirty |= dirty_bit;
+
+ for (int i = 0; i < IRIS_NOS_COUNT; i++) {
+ if (ish->nos & (1 << i))
+ ice->state.dirty_for_nos[i] |= dirty_bit;
+ else
+ ice->state.dirty_for_nos[i] &= ~dirty_bit;
+ }
}
static void
ice->state.cso_blend = state;
ice->state.dirty |= IRIS_DIRTY_PS_BLEND;
ice->state.dirty |= IRIS_DIRTY_BLEND_STATE;
+ ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_BLEND];
}
struct iris_depth_stencil_alpha_state {
ice->state.cso_zsa = new_cso;
ice->state.dirty |= IRIS_DIRTY_CC_VIEWPORT;
ice->state.dirty |= IRIS_DIRTY_WM_DEPTH_STENCIL;
+ ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_DEPTH_STENCIL_ALPHA];
}
struct iris_rasterizer_state {
ice->state.cso_rast = new_cso;
ice->state.dirty |= IRIS_DIRTY_RASTER;
ice->state.dirty |= IRIS_DIRTY_CLIP;
+ ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_RASTERIZER];
}
static uint32_t
/* Render target change */
ice->state.dirty |= IRIS_DIRTY_BINDINGS_FS;
+
+ ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_FRAMEBUFFER];
}
static void