D3D11: Added draw indirect support.

This commit is contained in:
Branimir Karadžić
2015-04-29 17:18:51 -07:00
parent 80b6202ec0
commit d763196407
5 changed files with 224 additions and 73 deletions

View File

@@ -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();