uint8_t derived_data[0];
};
+enum iris_param_domain {
+ IRIS_PARAM_DOMAIN_BUILTIN,
+ IRIS_PARAM_DOMAIN_UNIFORM,
+};
+
+#define IRIS_PARAM(domain, val) (IRIS_PARAM_DOMAIN_##domain << 24 | (val))
+#define IRIS_PARAM_DOMAIN(param) ((uint32_t)(param) >> 24)
+#define IRIS_PARAM_VALUE(param) ((uint32_t)(param) & 0x00ffffff)
+
/**
* Constant buffer (UBO) information. See iris_set_const_buffer().
*/
{
struct iris_shader_state *shs = &ice->state.shaders[stage];
struct iris_const_buffer *cbuf = &shs->constbuf[0];
+ struct iris_compiled_shader *shader = ice->shaders.prog[stage];
+ struct brw_stage_prog_data *prog_data = (void *) shader->prog_data;
+
+ unsigned upload_size = prog_data->nr_params * sizeof(uint32_t);
+ assert(upload_size >= shs->cbuf0.buffer_size);
+
+ uint32_t *map =
+ upload_state(ice->ctx.const_uploader, &cbuf->data, upload_size, 64);
+
+ for (int i = 0; i < prog_data->nr_params; i++) {
+ uint32_t param = prog_data->param[i];
+ uint32_t value = 0;
+
+ switch (IRIS_PARAM_DOMAIN(param)) {
+ case IRIS_PARAM_DOMAIN_BUILTIN:
+ assert(!"not used yet");
+ break;
+ case IRIS_PARAM_DOMAIN_UNIFORM:
+ if (shs->cbuf0.user_buffer) {
+ const uint32_t *src = shs->cbuf0.user_buffer;
+
+ value = src[IRIS_PARAM_VALUE(param)];
+ }
+ break;
+ }
+
+ *map++ = value;
+ }
if (shs->cbuf0.user_buffer) {
u_upload_data(ice->ctx.const_uploader, 0, shs->cbuf0.buffer_size, 32,