I want to use it in iris.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
assert((int)stage >= 0 && stage < ARRAY_SIZE(stage_sizes));
return stage_sizes[stage];
}
+
+void
+brw_prog_key_set_id(union brw_any_prog_key *key,
+ gl_shader_stage stage,
+ unsigned id)
+{
+ static const unsigned stage_offsets[] = {
+ offsetof(struct brw_vs_prog_key, program_string_id),
+ offsetof(struct brw_tcs_prog_key, program_string_id),
+ offsetof(struct brw_tes_prog_key, program_string_id),
+ offsetof(struct brw_gs_prog_key, program_string_id),
+ offsetof(struct brw_wm_prog_key, program_string_id),
+ offsetof(struct brw_cs_prog_key, program_string_id),
+ };
+ assert((int)stage >= 0 && stage < ARRAY_SIZE(stage_offsets));
+ *(unsigned*)((uint8_t*)key + stage_offsets[stage]) = id;
+}
unsigned
brw_prog_key_size(gl_shader_stage stage);
+void
+brw_prog_key_set_id(union brw_any_prog_key *key, gl_shader_stage, unsigned id);
+
/**
* Compile a vertex shader.
*
return next_binding_table_offset;
}
-void
-brw_prog_key_set_id(union brw_any_prog_key *key, gl_shader_stage stage,
- unsigned id)
-{
- static const unsigned stage_offsets[] = {
- offsetof(struct brw_vs_prog_key, program_string_id),
- offsetof(struct brw_tcs_prog_key, program_string_id),
- offsetof(struct brw_tes_prog_key, program_string_id),
- offsetof(struct brw_gs_prog_key, program_string_id),
- offsetof(struct brw_wm_prog_key, program_string_id),
- offsetof(struct brw_cs_prog_key, program_string_id),
- };
- assert((int)stage >= 0 && stage < ARRAY_SIZE(stage_offsets));
- *(unsigned*)((uint8_t*)key + stage_offsets[stage]) = id;
-}
-
void
brw_populate_default_key(const struct brw_compiler *compiler,
union brw_any_prog_key *prog_key,
struct brw_stage_prog_data *stage_prog_data,
uint32_t next_binding_table_offset);
-void
-brw_prog_key_set_id(union brw_any_prog_key *key, gl_shader_stage stage,
- unsigned id);
-
void
brw_populate_default_key(const struct brw_compiler *compiler,
union brw_any_prog_key *prog_key,