mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 21:42:59 +01:00
D3D11: Added draw indirect support.
This commit is contained in:
25
src/bgfx.cpp
25
src/bgfx.cpp
@@ -837,6 +837,7 @@ namespace bgfx
|
||||
CAPS_FLAGS(BGFX_CAPS_SWAP_CHAIN),
|
||||
CAPS_FLAGS(BGFX_CAPS_HMD),
|
||||
CAPS_FLAGS(BGFX_CAPS_INDEX32),
|
||||
CAPS_FLAGS(BGFX_CAPS_DRAW_INDIRECT),
|
||||
#undef CAPS_FLAGS
|
||||
};
|
||||
|
||||
@@ -2308,6 +2309,18 @@ again:
|
||||
return s_ctx->allocInstanceDataBuffer(_num, _stride);
|
||||
}
|
||||
|
||||
DrawIndirectBufferHandle createDrawIndirectBuffer(uint32_t _num)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
return s_ctx->createDrawIndirectBuffer(_num);
|
||||
}
|
||||
|
||||
void destroyDrawIndirectBuffer(DrawIndirectBufferHandle _handle)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
s_ctx->destroyDrawIndirectBuffer(_handle);
|
||||
}
|
||||
|
||||
ShaderHandle createShader(const Memory* _mem)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
@@ -2909,6 +2922,12 @@ again:
|
||||
s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num);
|
||||
}
|
||||
|
||||
void setDrawIndirectBuffer(DrawIndirectBufferHandle _handle, uint16_t _start, uint16_t _num)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
s_ctx->setDrawIndirectBuffer(_handle, _start, _num);
|
||||
}
|
||||
|
||||
void setProgram(ProgramHandle _handle)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
@@ -2957,6 +2976,12 @@ again:
|
||||
s_ctx->setBuffer(_stage, _handle, _access);
|
||||
}
|
||||
|
||||
void setBuffer(uint8_t _stage, DrawIndirectBufferHandle _handle, Access::Enum _access)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
s_ctx->setBuffer(_stage, _handle, _access);
|
||||
}
|
||||
|
||||
void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
|
||||
Reference in New Issue
Block a user