Halide
HalideRuntimeOpenGLCompute.h File Reference
#include "HalideRuntime.h"

Go to the source code of this file.

Macros

#define HALIDE_RUNTIME_OPENGLCOMPUTE
 

Functions

const struct halide_device_interface_thalide_openglcompute_device_interface ()
 
int halide_openglcompute_initialize_kernels (void *user_context, void **state_ptr, const char *src, int size)
 These are forward declared here to allow clients to override the Halide Glsl runtime. More...
 
int halide_openglcompute_run (void *user_context, void *state_ptr, const char *entry_name, int blocksX, int blocksY, int blocksZ, int threadsX, int threadsY, int threadsZ, int shared_mem_bytes, struct halide_type_t arg_types[], void *args[], int8_t is_buffer[], int num_attributes, float *vertex_buffer, int num_coords_dim0, int num_coords_dim1)
 This function triggers execution of OpenGL program built around compute shader. More...
 
void * halide_opengl_get_proc_address (void *user_context, const char *name)
 This function retrieves pointers to OpenGL API functions. More...
 
int halide_opengl_create_context (void *user_context)
 This function creates an OpenGL context for use by the OpenGL backend. More...
 

Detailed Description

Routines specific to the Halide OpenGL Compute runtime.

Definition in file HalideRuntimeOpenGLCompute.h.

Macro Definition Documentation

◆ HALIDE_RUNTIME_OPENGLCOMPUTE

#define HALIDE_RUNTIME_OPENGLCOMPUTE

Definition at line 19 of file HalideRuntimeOpenGLCompute.h.

Function Documentation

◆ halide_openglcompute_device_interface()

const struct halide_device_interface_t* halide_openglcompute_device_interface ( )

◆ halide_openglcompute_initialize_kernels()

int halide_openglcompute_initialize_kernels ( void *  user_context,
void **  state_ptr,
const char *  src,
int  size 
)

These are forward declared here to allow clients to override the Halide Glsl runtime.

Do not call them. This function sets up OpenGL context, loads relevant GL functions, then compiles src OpenGL compute shader into OpenGL program and stores it for future use.

◆ halide_openglcompute_run()

int halide_openglcompute_run ( void *  user_context,
void *  state_ptr,
const char *  entry_name,
int  blocksX,
int  blocksY,
int  blocksZ,
int  threadsX,
int  threadsY,
int  threadsZ,
int  shared_mem_bytes,
struct halide_type_t  arg_types[],
void *  args[],
int8_t  is_buffer[],
int  num_attributes,
float *  vertex_buffer,
int  num_coords_dim0,
int  num_coords_dim1 
)

This function triggers execution of OpenGL program built around compute shader.

Execution of the shader is parallelized into given number of blocks and threads.

This function doesn't wait for the completion of the shader, but it sets memory barrier which forces successive retrieval of output data to wait until shader is done.

◆ halide_opengl_get_proc_address()

void* halide_opengl_get_proc_address ( void *  user_context,
const char *  name 
)

This function retrieves pointers to OpenGL API functions.

You may have to implement this yourself. Halide only provides implementations for some platforms."

◆ halide_opengl_create_context()

int halide_opengl_create_context ( void *  user_context)

This function creates an OpenGL context for use by the OpenGL backend.

You may have to implement this yourself as well. Halide only provides implementations for some platforms."