|
|
@@ -3364,6 +3364,14 @@ BGFX_C_API bgfx_program_handle_t bgfx_create_program(bgfx_shader_handle_t _vsh,
|
|
|
return handle.c;
|
|
|
}
|
|
|
|
|
|
+BGFX_C_API bgfx_program_handle_t bgfx_create_compute_program(bgfx_shader_handle_t _csh, bool _destroyShaders)
|
|
|
+{
|
|
|
+ union { bgfx_shader_handle_t c; bgfx::ShaderHandle cpp; } csh = { _csh };
|
|
|
+ union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle;
|
|
|
+ handle.cpp = bgfx::createProgram(csh.cpp, _destroyShaders);
|
|
|
+ return handle.c;
|
|
|
+}
|
|
|
+
|
|
|
BGFX_C_API void bgfx_destroy_program(bgfx_program_handle_t _handle)
|
|
|
{
|
|
|
union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
|
|
|
@@ -3619,6 +3627,18 @@ BGFX_C_API void bgfx_set_instance_data_buffer(const bgfx_instance_data_buffer_t*
|
|
|
bgfx::setInstanceDataBuffer( (const bgfx::InstanceDataBuffer*)_idb, _num);
|
|
|
}
|
|
|
|
|
|
+BGFX_C_API void bgfx_set_instance_data_from_vertex_buffer(bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num)
|
|
|
+{
|
|
|
+ union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setInstanceDataBuffer(handle.cpp, _startVertex, _num);
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num)
|
|
|
+{
|
|
|
+ union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setInstanceDataBuffer(handle.cpp, _startVertex, _num);
|
|
|
+}
|
|
|
+
|
|
|
BGFX_C_API void bgfx_set_program(bgfx_program_handle_t _handle)
|
|
|
{
|
|
|
union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
|
|
|
@@ -3664,6 +3684,36 @@ BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_ha
|
|
|
bgfx::setImage(_stage, sampler.cpp, handle.cpp, _attachment, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
|
|
|
}
|
|
|
|
|
|
+BGFX_C_API void bgfx_set_compute_index_buffer(uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access)
|
|
|
+{
|
|
|
+ union { bgfx_index_buffer_handle_t c; bgfx::IndexBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setBuffer(_stage, handle.cpp, bgfx::Access::Enum(_access) );
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API void bgfx_set_compute_vertex_buffer(uint8_t _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access)
|
|
|
+{
|
|
|
+ union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setBuffer(_stage, handle.cpp, bgfx::Access::Enum(_access) );
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API void bgfx_set_compute_dynamic_index_buffer(uint8_t _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access)
|
|
|
+{
|
|
|
+ union { bgfx_dynamic_index_buffer_handle_t c; bgfx::DynamicIndexBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setBuffer(_stage, handle.cpp, bgfx::Access::Enum(_access) );
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API void bgfx_set_compute_dynamic_vertex_buffer(uint8_t _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access)
|
|
|
+{
|
|
|
+ union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setBuffer(_stage, handle.cpp, bgfx::Access::Enum(_access) );
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API void bgfx_set_compute_indirect_buffer(uint8_t _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access)
|
|
|
+{
|
|
|
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::setBuffer(_stage, handle.cpp, bgfx::Access::Enum(_access) );
|
|
|
+}
|
|
|
+
|
|
|
BGFX_C_API uint32_t bgfx_dispatch(uint8_t _id, bgfx_program_handle_t _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags)
|
|
|
{
|
|
|
union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
|