summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/bgfx_p.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/bgfx_p.h')
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index 594310d284f..1434b5ca41f 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -573,8 +573,14 @@ namespace bgfx
const char* getPredefinedUniformName(PredefinedUniform::Enum _enum);
PredefinedUniform::Enum nameToPredefinedUniformEnum(const char* _name);
- struct CommandBuffer
+ class CommandBuffer
{
+ BX_CLASS(CommandBuffer
+ , NO_COPY
+ , NO_ASSIGNMENT
+ );
+
+ public:
CommandBuffer()
: m_pos(0)
, m_size(BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE)
@@ -690,10 +696,6 @@ namespace bgfx
uint32_t m_pos;
uint32_t m_size;
uint8_t m_buffer[BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE];
-
- private:
- CommandBuffer(const CommandBuffer&);
- void operator=(const CommandBuffer&);
};
#define SORT_KEY_NUM_BITS_TRANS 2
@@ -2050,7 +2052,7 @@ namespace bgfx
virtual void overrideInternal(TextureHandle _handle, uintptr_t _ptr) = 0;
virtual uintptr_t getInternal(TextureHandle _handle) = 0;
virtual void destroyTexture(TextureHandle _handle) = 0;
- virtual void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) = 0;
+ virtual void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) = 0;
virtual void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) = 0;
virtual void destroyFrameBuffer(FrameBufferHandle _handle) = 0;
virtual void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) = 0;
@@ -3182,14 +3184,14 @@ namespace bgfx
cmdbuf.write(_mem);
}
- bool checkFrameBuffer(uint8_t _num, const TextureHandle* _handles) const
+ bool checkFrameBuffer(uint8_t _num, const Attachment* _attachment) const
{
uint8_t color = 0;
uint8_t depth = 0;
for (uint32_t ii = 0; ii < _num; ++ii)
{
- TextureHandle texHandle = _handles[ii];
+ TextureHandle texHandle = _attachment[ii].handle;
if (isDepth(TextureFormat::Enum(m_textureRef[texHandle.idx].m_format)))
{
++depth;
@@ -3205,9 +3207,9 @@ namespace bgfx
;
}
- BGFX_API_FUNC(FrameBufferHandle createFrameBuffer(uint8_t _num, const TextureHandle* _handles, bool _destroyTextures) )
+ BGFX_API_FUNC(FrameBufferHandle createFrameBuffer(uint8_t _num, const Attachment* _attachment, bool _destroyTextures) )
{
- BX_CHECK(checkFrameBuffer(_num, _handles)
+ BX_CHECK(checkFrameBuffer(_num, _attachment)
, "Too many frame buffer attachments (num attachments: %d, max color attachments %d)!"
, _num
, g_caps.maxFBAttachments
@@ -3226,26 +3228,26 @@ namespace bgfx
FrameBufferRef& ref = m_frameBufferRef[handle.idx];
ref.m_window = false;
memset(ref.un.m_th, 0xff, sizeof(ref.un.m_th) );
- BackbufferRatio::Enum bbRatio = BackbufferRatio::Enum(m_textureRef[_handles[0].idx].m_bbRatio);
+ BackbufferRatio::Enum bbRatio = BackbufferRatio::Enum(m_textureRef[_attachment[0].handle.idx].m_bbRatio);
for (uint32_t ii = 0; ii < _num; ++ii)
{
- TextureHandle texHandle = _handles[ii];
+ TextureHandle texHandle = _attachment[ii].handle;
BGFX_CHECK_HANDLE("createFrameBuffer texture handle", m_textureHandle, texHandle);
BX_CHECK(bbRatio == m_textureRef[texHandle.idx].m_bbRatio, "Mismatch in texture back-buffer ratio.");
BX_UNUSED(bbRatio);
- cmdbuf.write(texHandle);
-
ref.un.m_th[ii] = texHandle;
textureIncRef(texHandle);
}
+
+ cmdbuf.write(_attachment, sizeof(Attachment) * _num);
}
if (_destroyTextures)
{
for (uint32_t ii = 0; ii < _num; ++ii)
{
- textureTakeOwnership(_handles[ii]);
+ textureTakeOwnership(_attachment[ii].handle);
}
}