GPU: Add extern "C" to intern headers

This commit is contained in:
Clément Foucault 2020-07-25 18:10:43 +02:00
parent 076d033e10
commit a77175c9b6
6 changed files with 50 additions and 0 deletions

View File

@ -29,6 +29,11 @@
#include "GPU_shader_interface.h"
#include "GPU_vertex_format.h"
#ifdef __cplusplus
extern "C" {
#endif
/* TODO(fclem) remove, use shaderface directly. */
void AttrBinding_clear(GPUAttrBinding *binding);
void get_attr_locations(const GPUVertFormat *format,
@ -36,4 +41,8 @@ void get_attr_locations(const GPUVertFormat *format,
const GPUShaderInterface *shaderface);
uint read_attr_location(const GPUAttrBinding *binding, uint a_idx);
#ifdef __cplusplus
}
#endif
#endif /* __GPU_ATTR_BINDING_PRIVATE_H__ */

View File

@ -26,6 +26,10 @@
#ifndef __GPU_CODEGEN_H__
#define __GPU_CODEGEN_H__
#ifdef __cplusplus
extern "C" {
#endif
struct GPUMaterial;
struct GPUNodeGraph;
struct GPUOutput;
@ -68,4 +72,8 @@ void GPU_pass_release(GPUPass *pass);
void gpu_codegen_init(void);
void gpu_codegen_exit(void);
#ifdef __cplusplus
}
#endif
#endif /* __GPU_CODEGEN_H__ */

View File

@ -26,6 +26,15 @@
#ifndef __GPU_PRIMITIVE_PRIVATE_H__
#define __GPU_PRIMITIVE_PRIVATE_H__
#ifdef __cplusplus
extern "C" {
#endif
/* TODO(fclem) move to OGL backend */
GLenum convert_prim_type_to_gl(GPUPrimType);
#ifdef __cplusplus
}
#endif
#endif /* __GPU_PRIMITIVE_PRIVATE_H__ */

View File

@ -21,6 +21,10 @@
#ifndef __GPU_PRIVATE_H__
#define __GPU_PRIVATE_H__
#ifdef __cplusplus
extern "C" {
#endif
/* call this before running any of the functions below */
void gpu_platform_init(void);
void gpu_platform_exit(void);
@ -41,4 +45,8 @@ void gpu_framebuffer_module_exit(void);
void gpu_pbvh_init(void);
void gpu_pbvh_exit(void);
#ifdef __cplusplus
}
#endif
#endif /* __GPU_PRIVATE_H__ */

View File

@ -24,6 +24,10 @@
#include "GPU_glew.h"
#include "GPU_shader_interface.h"
#ifdef __cplusplus
extern "C" {
#endif
struct GPUShader {
/** Handle for full program (links shader stages below). */
GLuint program;
@ -47,4 +51,8 @@ struct GPUShader {
/* XXX do not use it. Special hack to use OCIO with batch API. */
void immGetProgram(GLuint *program, GPUShaderInterface **shaderface);
#ifdef __cplusplus
}
#endif
#endif /* __GPU_SHADER_PRIVATE_H__ */

View File

@ -26,8 +26,16 @@
#ifndef __GPU_VERTEX_FORMAT_PRIVATE_H__
#define __GPU_VERTEX_FORMAT_PRIVATE_H__
#ifdef __cplusplus
extern "C" {
#endif
void VertexFormat_pack(GPUVertFormat *format);
uint padding(uint offset, uint alignment);
uint vertex_buffer_size(const GPUVertFormat *format, uint vertex_len);
#ifdef __cplusplus
}
#endif
#endif /* __GPU_VERTEX_FORMAT_PRIVATE_H__ */