Rename setShaderBuffer to setBuffer.

This commit is contained in:
Branimir Karadžić
2017-04-06 19:03:16 -07:00
parent 83e30ec609
commit e5395db19c
2 changed files with 12 additions and 28 deletions

View File

@@ -3818,18 +3818,18 @@ error:
s_ctx->setBuffer(_stage, _handle, _access);
}
void setShaderBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle)
void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle)
{
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->setShaderBuffer(_stage, _handle);
s_ctx->setBuffer(_stage, _handle);
}
void setShaderBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle)
void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle)
{
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->setShaderBuffer(_stage, _handle);
s_ctx->setBuffer(_stage, _handle);
}
void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)
@@ -4852,18 +4852,6 @@ BGFX_C_API void bgfx_set_compute_dynamic_vertex_buffer(uint8_t _stage, bgfx_dyna
bgfx::setBuffer(_stage, handle.cpp, bgfx::Access::Enum(_access) );
}
BGFX_C_API void bgfx_set_shader_dynamic_index_buffer(uint8_t _stage, bgfx_dynamic_index_buffer_handle_t _handle)
{
union { bgfx_dynamic_index_buffer_handle_t c; bgfx::DynamicIndexBufferHandle cpp; } handle = { _handle };
bgfx::setShaderBuffer(_stage, handle.cpp);
}
BGFX_C_API void bgfx_set_shader_dynamic_vertex_buffer(uint8_t _stage, bgfx_dynamic_vertex_buffer_handle_t _handle)
{
union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
bgfx::setShaderBuffer(_stage, handle.cpp);
}
BGFX_C_API void bgfx_set_compute_indirect_buffer(uint8_t _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access)
{
union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } handle = { _handle };

View File

@@ -1677,24 +1677,20 @@ namespace bgfx
bind.m_un.m_compute.m_mip = 0;
}
void setShaderBuffer(uint8_t _stage, IndexBufferHandle _handle)
void setBuffer(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)
void setBuffer(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)
@@ -4059,18 +4055,18 @@ namespace bgfx
m_submit->setBuffer(_stage, dvb.m_handle, _access);
}
BGFX_API_FUNC(void setShaderBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle))
BGFX_API_FUNC(void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle))
{
BGFX_CHECK_HANDLE("setShaderBuffer", m_dynamicIndexBufferHandle, _handle);
BGFX_CHECK_HANDLE("setBuffer", m_dynamicIndexBufferHandle, _handle);
const DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx];
m_submit->setShaderBuffer(_stage, dib.m_handle);
m_submit->setBuffer(_stage, dib.m_handle);
}
BGFX_API_FUNC(void setShaderBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle) )
BGFX_API_FUNC(void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle) )
{
BGFX_CHECK_HANDLE("setShaderBuffer", m_dynamicVertexBufferHandle, _handle);
BGFX_CHECK_HANDLE("setBuffer", m_dynamicVertexBufferHandle, _handle);
const DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx];
m_submit->setShaderBuffer(_stage, dvb.m_handle);
m_submit->setBuffer(_stage, dvb.m_handle);
}
BGFX_API_FUNC(void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access) )