|
|
@@ -1677,6 +1677,26 @@ namespace bgfx
|
|
|
bind.m_un.m_compute.m_mip = 0;
|
|
|
}
|
|
|
|
|
|
+ void setShaderBuffer(uint8_t _stage, IndexBufferHandle _handle)
|
|
|
+ {
|
|
|
+ Binding& bind = m_draw.m_bind[_stage];
|
|
|
+ bind.m_idx = _handle.idx;
|
|
|
+ bind.m_type = uint8_t(Binding::IndexBuffer);
|
|
|
+ bind.m_un.m_compute.m_access = uint8_t(Access::Read);
|
|
|
+
|
|
|
+ // TODO: should this take in a uniform as well for opengl?
|
|
|
+ }
|
|
|
+
|
|
|
+ void setShaderBuffer(uint8_t _stage, VertexBufferHandle _handle)
|
|
|
+ {
|
|
|
+ Binding& bind = m_draw.m_bind[_stage];
|
|
|
+ bind.m_idx = _handle.idx;
|
|
|
+ bind.m_type = uint8_t(Binding::VertexBuffer);
|
|
|
+ bind.m_un.m_compute.m_access = uint8_t(Access::Read);
|
|
|
+
|
|
|
+ // TODO: should this take in a uniform as well for opengl?
|
|
|
+ }
|
|
|
+
|
|
|
void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
{
|
|
|
Binding& bind = m_compute.m_bind[_stage];
|
|
|
@@ -4039,6 +4059,20 @@ namespace bgfx
|
|
|
m_submit->setBuffer(_stage, dvb.m_handle, _access);
|
|
|
}
|
|
|
|
|
|
+ BGFX_API_FUNC(void setShaderBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle))
|
|
|
+ {
|
|
|
+ BGFX_CHECK_HANDLE("setShaderBuffer", m_dynamicIndexBufferHandle, _handle);
|
|
|
+ const DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx];
|
|
|
+ m_submit->setShaderBuffer(_stage, dib.m_handle);
|
|
|
+ }
|
|
|
+
|
|
|
+ BGFX_API_FUNC(void setShaderBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle) )
|
|
|
+ {
|
|
|
+ BGFX_CHECK_HANDLE("setShaderBuffer", m_dynamicVertexBufferHandle, _handle);
|
|
|
+ const DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx];
|
|
|
+ m_submit->setShaderBuffer(_stage, dvb.m_handle);
|
|
|
+ }
|
|
|
+
|
|
|
BGFX_API_FUNC(void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access) )
|
|
|
{
|
|
|
BGFX_CHECK_HANDLE("setBuffer", m_vertexBufferHandle, _handle);
|