#define IRIS_DIRTY_FS (1ull << 32)
#define IRIS_DIRTY_CS (1ull << 33)
#define IRIS_DIRTY_URB (1ull << 34)
+#define IRIS_DIRTY_CONSTANTS_VS (1ull << 35)
+#define IRIS_DIRTY_CONSTANTS_TCS (1ull << 36)
+#define IRIS_DIRTY_CONSTANTS_TES (1ull << 37)
+#define IRIS_DIRTY_CONSTANTS_GS (1ull << 38)
+#define IRIS_DIRTY_CONSTANTS_FS (1ull << 39)
struct iris_depth_stencil_alpha_state;
}
}
+static const uint32_t push_constant_opcodes[] = {
+ [MESA_SHADER_VERTEX] = 21,
+ [MESA_SHADER_TESS_CTRL] = 25, /* HS */
+ [MESA_SHADER_TESS_EVAL] = 26, /* DS */
+ [MESA_SHADER_GEOMETRY] = 22,
+ [MESA_SHADER_FRAGMENT] = 23,
+ [MESA_SHADER_COMPUTE] = 0,
+};
+
static void
iris_upload_render_state(struct iris_context *ice,
struct iris_batch *batch,
}
}
- // XXX: 3DSTATE_CONSTANT_XS
+ for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
+ if (!(dirty & (IRIS_DIRTY_CONSTANTS_VS << stage)))
+ continue;
+
+ iris_emit_cmd(batch, GENX(3DSTATE_CONSTANT_VS), pkt) {
+ pkt._3DCommandSubOpcode = push_constant_opcodes[stage];
+ if (ice->shaders.prog[stage]) {
+ // XXX: 3DSTATE_CONSTANT_XS
+ }
+ }
+ }
+
// Surfaces:
// - pull constants
// - ubos/ssbos/abos