intel: Move brw_prog_key_set_id from i965 to the compiler.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 20 May 2019 18:24:21 +0000 (11:24 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 21 May 2019 22:05:38 +0000 (15:05 -0700)
I want to use it in iris.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
src/intel/compiler/brw_compiler.c
src/intel/compiler/brw_compiler.h
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_program.h

index 6a41cd20270709f06ad18fc577a9ea4df840e5a9..bded536c9485379640cafd1ef967d81ba904399b 100644 (file)
@@ -262,3 +262,20 @@ brw_prog_key_size(gl_shader_stage stage)
    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;
+}
index 8c6ae35636bb0f84cd6815cf53ad3db476cc3440..3c109c504b1af049486de8708e6ec31e8e0d4673 100644 (file)
@@ -1230,6 +1230,9 @@ brw_prog_data_size(gl_shader_stage stage);
 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.
  *
index deb0f1cf22565d499ffac01fe78b3ddb5d30e39d..9eac83b7254cdf397c5cceb923df7e8943963626 100644 (file)
@@ -868,22 +868,6 @@ brw_assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
    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,
index 117019d00c71d8012628fdc828367fe8fbdafb64..8eb9620ab1eb9fa21e0d4fc80db7c35e9f48dda8 100644 (file)
@@ -81,10 +81,6 @@ brw_assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
                                         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,