From: Kenneth Graunke Date: Fri, 26 Jan 2018 05:39:44 +0000 (-0800) Subject: iris: dummy constants X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb3c0be7a8c390e9dc14d458c0ca63d44c769870;p=mesa.git iris: dummy constants --- diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index fc1b4c572db..0c67535df82 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -74,6 +74,11 @@ struct iris_batch; #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; diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 289bc1c4711..2e0dfd0ace9 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1733,6 +1733,15 @@ iris_upload_urb_config(struct iris_context *ice, struct iris_batch *batch) } } +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, @@ -1793,7 +1802,18 @@ iris_upload_render_state(struct iris_context *ice, } } - // 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