|
|
@@ -3321,6 +3321,19 @@ BGFX_C_API const bgfx_instance_data_buffer_t* bgfx_alloc_instance_data_buffer(ui
|
|
|
return (bgfx_instance_data_buffer_t*)bgfx::allocInstanceDataBuffer(_num, _stride);
|
|
|
}
|
|
|
|
|
|
+BGFX_C_API bgfx_indirect_buffer_handle_t bgfx_create_indirect_buffer(uint32_t _num)
|
|
|
+{
|
|
|
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } handle;
|
|
|
+ handle.cpp = bgfx::createIndirectBuffer(_num);
|
|
|
+ return handle.c;
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API void bgfx_destroy_indirect_buffer(bgfx_indirect_buffer_handle_t _handle)
|
|
|
+{
|
|
|
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } handle = { _handle };
|
|
|
+ bgfx::destroyIndirectBuffer(handle.cpp);
|
|
|
+}
|
|
|
+
|
|
|
BGFX_C_API bgfx_shader_handle_t bgfx_create_shader(const bgfx_memory_t* _mem)
|
|
|
{
|
|
|
union { bgfx_shader_handle_t c; bgfx::ShaderHandle cpp; } handle;
|
|
|
@@ -3629,6 +3642,12 @@ BGFX_C_API uint32_t bgfx_submit(uint8_t _id, int32_t _depth)
|
|
|
return bgfx::submit(_id, _depth);
|
|
|
}
|
|
|
|
|
|
+BGFX_C_API uint32_t bgfx_submit_indirect(uint8_t _id, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
|
|
|
+{
|
|
|
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle };
|
|
|
+ return bgfx::submit(_id, indirectHandle.cpp, _start, _num, _depth);
|
|
|
+}
|
|
|
+
|
|
|
BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
|
|
|
{
|
|
|
union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
|
|
|
@@ -3643,10 +3662,17 @@ 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_dispatch(uint8_t _id, bgfx_program_handle_t _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags)
|
|
|
+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 };
|
|
|
+ return bgfx::dispatch(_id, handle.cpp, _numX, _numY, _numZ, _flags);
|
|
|
+}
|
|
|
+
|
|
|
+BGFX_C_API uint32_t bgfx_dispatch_indirect(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags)
|
|
|
{
|
|
|
union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
|
|
|
- bgfx::dispatch(_id, handle.cpp, _numX, _numY, _numZ, _flags);
|
|
|
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle };
|
|
|
+ return bgfx::dispatch(_id, handle.cpp, indirectHandle.cpp, _start, _num, _flags);
|
|
|
}
|
|
|
|
|
|
BGFX_C_API void bgfx_discard()
|