|
@@ -3495,7 +3495,7 @@ error:
|
|
|
void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
|
|
void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
- s_ctx->setVertexBuffer(_handle, _startVertex, _numVertices);
|
|
|
|
|
|
|
+ s_ctx->setVertexBuffer(0, _handle, _startVertex, _numVertices);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setVertexBuffer(DynamicVertexBufferHandle _handle)
|
|
void setVertexBuffer(DynamicVertexBufferHandle _handle)
|
|
@@ -3506,7 +3506,7 @@ error:
|
|
|
void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
|
|
void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
- s_ctx->setVertexBuffer(_handle, _startVertex, _numVertices);
|
|
|
|
|
|
|
+ s_ctx->setVertexBuffer(0, _handle, _startVertex, _numVertices);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setVertexBuffer(const TransientVertexBuffer* _tvb)
|
|
void setVertexBuffer(const TransientVertexBuffer* _tvb)
|
|
@@ -3518,7 +3518,7 @@ error:
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
|
|
BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
|
|
|
- s_ctx->setVertexBuffer(_tvb, _startVertex, _numVertices);
|
|
|
|
|
|
|
+ s_ctx->setVertexBuffer(0, _tvb, _startVertex, _numVertices);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint32_t _num)
|
|
void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint32_t _num)
|
|
@@ -3543,12 +3543,15 @@ error:
|
|
|
void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags)
|
|
void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setTexture(_stage, _sampler, _handle, _flags);
|
|
s_ctx->setTexture(_stage, _sampler, _handle, _flags);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setTexture(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, uint32_t _flags)
|
|
void setTexture(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, uint32_t _flags)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
|
|
+ BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment);
|
|
|
s_ctx->setTexture(_stage, _sampler, _handle, _attachment, _flags);
|
|
s_ctx->setTexture(_stage, _sampler, _handle, _attachment, _flags);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3584,42 +3587,50 @@ error:
|
|
|
void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
|
|
void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
|
|
void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
|
|
void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
|
|
void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)
|
|
void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
s_ctx->setBuffer(_stage, _handle, _access);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
s_ctx->setImage(_stage, _sampler, _handle, _mip, _access, _format);
|
|
s_ctx->setImage(_stage, _sampler, _handle, _mip, _access, _format);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format)
|
|
void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
|
|
+ BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
|
|
+ BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment);
|
|
|
s_ctx->setImage(_stage, _sampler, _handle, _attachment, _access, _format);
|
|
s_ctx->setImage(_stage, _sampler, _handle, _attachment, _access, _format);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3662,6 +3673,7 @@ error:
|
|
|
{
|
|
{
|
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
BGFX_CHECK_MAIN_THREAD();
|
|
|
BGFX_CHECK_CAPS(BGFX_CAPS_TEXTURE_BLIT, "Texture blit is not supported!");
|
|
BGFX_CHECK_CAPS(BGFX_CAPS_TEXTURE_BLIT, "Texture blit is not supported!");
|
|
|
|
|
+ BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment);
|
|
|
s_ctx->blit(_id, _dst, _dstMip, _dstX, _dstY, _dstZ, _src, _attachment, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth);
|
|
s_ctx->blit(_id, _dst, _dstMip, _dstX, _dstY, _dstZ, _src, _attachment, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth);
|
|
|
}
|
|
}
|
|
|
|
|
|