i965: Make precompile functions accessible from C.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Nov 2014 07:46:39 +0000 (23:46 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Nov 2014 23:30:09 +0000 (15:30 -0800)
Previously, the prototypes for brw_vs/gs/fs_precompile were scattered
between brw_vs.h (C), brw_gs.h (C), and brw_fs.h (C++ only).  Also,
brw_fs_precompile had C++ linkage, while the others were C.

This patch moves all the prototypes to a central location (brw_shader.h)
and makes brw_fs_precompile have C linkage.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_gs.h
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vs.h

index f3f69c46c2cbaa7dcac18bd2c6a963c9656fa57f..0ffb07fc8cdce5e2f9ba6d03830ae29e271c4d31 100644 (file)
@@ -3748,7 +3748,7 @@ brw_wm_fs_emit(struct brw_context *brw,
    return g.get_assembly(final_assembly_size);
 }
 
-bool
+extern "C" bool
 brw_fs_precompile(struct gl_context *ctx,
                   struct gl_shader_program *shader_prog,
                   struct gl_program *prog)
index f558662064b0d57e8e0cbe4f9510774cecb46cbd..ee612079f2a8860e18b8fbb52219e69d1470d301 100644 (file)
@@ -797,8 +797,5 @@ private:
 
 bool brw_do_channel_expressions(struct exec_list *instructions);
 bool brw_do_vector_splitting(struct exec_list *instructions);
-bool brw_fs_precompile(struct gl_context *ctx,
-                       struct gl_shader_program *shader_prog,
-                       struct gl_program *prog);
 
 struct brw_reg brw_reg_from_fs_reg(fs_reg *reg);
index 85228eb5e7871fd6a3af249ec647af2e5ce22ab9..5a15fa92018f04c1ec80b78996071ad4ac244473 100644 (file)
@@ -34,9 +34,6 @@ struct gl_context;
 struct gl_shader_program;
 struct gl_program;
 
-bool brw_gs_precompile(struct gl_context *ctx,
-                       struct gl_shader_program *shader_prog,
-                       struct gl_program *prog);
 bool brw_gs_prog_data_compare(const void *a, const void *b);
 
 #ifdef __cplusplus
index cdf86ff3cee25bcb5ba5731c01f18e414f733edb..05434a7f76e08f83ca74105eee1c2b1894826d01 100644 (file)
@@ -192,3 +192,21 @@ enum brw_reg_type brw_type_for_base_type(const struct glsl_type *type);
 enum brw_conditional_mod brw_conditional_for_comparison(unsigned int op);
 uint32_t brw_math_function(enum opcode op);
 const char *brw_instruction_name(enum opcode op);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+bool brw_vs_precompile(struct gl_context *ctx,
+                       struct gl_shader_program *shader_prog,
+                       struct gl_program *prog);
+bool brw_gs_precompile(struct gl_context *ctx,
+                       struct gl_shader_program *shader_prog,
+                       struct gl_program *prog);
+bool brw_fs_precompile(struct gl_context *ctx,
+                       struct gl_shader_program *shader_prog,
+                       struct gl_program *prog);
+
+#ifdef __cplusplus
+}
+#endif
index 77792d99b47fd0efe3710cb758d572eb6958af70..f6e6b31f68be841518f4d8ba4b4ce4f4fdf40f50 100644 (file)
@@ -89,9 +89,6 @@ const unsigned *brw_vs_emit(struct brw_context *brw,
                             struct brw_vs_prog_data *prog_data,
                             void *mem_ctx,
                             unsigned *program_size);
-bool brw_vs_precompile(struct gl_context *ctx,
-                       struct gl_shader_program *shader_prog,
-                       struct gl_program *prog);
 void brw_vs_debug_recompile(struct brw_context *brw,
                             struct gl_shader_program *prog,
                             const struct brw_vs_prog_key *key);