aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_context.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-02-09 14:21:54 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:05 -0800
commita50a3a8edfddbabf6ed6b3fd55e7b6bc97fb225e (patch)
treee396c209f2cf7b95f9c2a973b6e5e40d9a82c1b8 /src/gallium/drivers/iris/iris_context.h
parent213b70a22209ddfe4aead127e81ed06c51bf223e (diff)
iris: uniform bits...badly
Diffstat (limited to 'src/gallium/drivers/iris/iris_context.h')
-rw-r--r--src/gallium/drivers/iris/iris_context.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 0c67535df82..e70e6db4713 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -80,6 +80,29 @@ struct iris_batch;
#define IRIS_DIRTY_CONSTANTS_GS (1ull << 38)
#define IRIS_DIRTY_CONSTANTS_FS (1ull << 39)
+enum brw_param_domain {
+ BRW_PARAM_DOMAIN_BUILTIN = 0,
+ BRW_PARAM_DOMAIN_PARAMETER,
+ BRW_PARAM_DOMAIN_UNIFORM,
+ BRW_PARAM_DOMAIN_IMAGE,
+};
+
+#define BRW_PARAM(domain, val) (BRW_PARAM_DOMAIN_##domain << 24 | (val))
+#define BRW_PARAM_DOMAIN(param) ((uint32_t)(param) >> 24)
+#define BRW_PARAM_VALUE(param) ((uint32_t)(param) & 0x00ffffff)
+
+#define BRW_PARAM_PARAMETER(idx, comp) \
+ BRW_PARAM(PARAMETER, ((idx) << 2) | (comp))
+#define BRW_PARAM_PARAMETER_IDX(param) (BRW_PARAM_VALUE(param) >> 2)
+#define BRW_PARAM_PARAMETER_COMP(param) (BRW_PARAM_VALUE(param) & 0x3)
+
+#define BRW_PARAM_UNIFORM(idx) BRW_PARAM(UNIFORM, (idx))
+#define BRW_PARAM_UNIFORM_IDX(param) BRW_PARAM_VALUE(param)
+
+#define BRW_PARAM_IMAGE(idx, offset) BRW_PARAM(IMAGE, ((idx) << 8) | (offset))
+#define BRW_PARAM_IMAGE_IDX(value) (BRW_PARAM_VALUE(value) >> 8)
+#define BRW_PARAM_IMAGE_OFFSET(value) (BRW_PARAM_VALUE(value) & 0xf)
+
struct iris_depth_stencil_alpha_state;
enum iris_program_cache_id {
@@ -112,6 +135,13 @@ struct iris_compiled_shader {
uint8_t derived_data[0];
};
+struct iris_shader_state {
+ struct pipe_constant_buffer constbuf[PIPE_MAX_CONSTANT_BUFFERS];
+ struct pipe_resource *push_resource;
+ unsigned const_offset;
+ unsigned const_size;
+};
+
struct iris_context {
struct pipe_context ctx;
@@ -122,6 +152,8 @@ struct iris_context {
struct iris_compiled_shader *prog[MESA_SHADER_STAGES];
struct brw_vue_map *last_vue_map;
+ struct iris_shader_state state[MESA_SHADER_STAGES];
+
struct u_upload_mgr *uploader;
struct hash_table *cache;