From e5395db19c4aebda467c151b111ad1dd94352504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 6 Apr 2017 19:03:16 -0700 Subject: [PATCH] Rename setShaderBuffer to setBuffer. --- src/bgfx.cpp | 20 ++++---------------- src/bgfx_p.h | 20 ++++++++------------ 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index a4c5db6b9..594e9f91f 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -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 }; diff --git a/src/bgfx_p.h b/src/bgfx_p.h index f3e645046..75c675640 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -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) )