summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/renderer_d3d11.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/renderer_d3d11.cpp')
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index b15f0a12886..a2ddbd687a3 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2023 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -1235,6 +1235,9 @@ namespace bgfx { namespace d3d11
| ((m_featureLevel >= D3D_FEATURE_LEVEL_11_1)
? BGFX_CAPS_IMAGE_RW
: 0)
+ | ((m_featureLevel >= D3D_FEATURE_LEVEL_11_0)
+ ? BGFX_CAPS_PRIMITIVE_ID
+ : 0)
);
m_timerQuerySupport = m_featureLevel >= D3D_FEATURE_LEVEL_10_0;
@@ -1617,7 +1620,7 @@ namespace bgfx { namespace d3d11
DX_RELEASE(m_msaaRt, 0);
#if BX_PLATFORM_WINRT
// Remove swap chain from SwapChainPanel (nwh) if applicable
- m_dxgi.removeSwapChain(m_scd, &m_swapChain);
+ m_dxgi.removeSwapChain(m_scd);
#endif
DX_RELEASE(m_swapChain, 0);
DX_RELEASE(m_deviceCtx, 0);
@@ -1708,7 +1711,7 @@ namespace bgfx { namespace d3d11
DX_RELEASE(m_msaaRt, 0);
#if BX_PLATFORM_WINRT
// Remove swap chain from SwapChainPanel (nwh) if applicable
- m_dxgi.removeSwapChain(m_scd, &m_swapChain);
+ m_dxgi.removeSwapChain(m_scd);
#endif
DX_RELEASE(m_swapChain, 0);
DX_RELEASE(m_deviceCtx, 0);
@@ -1963,11 +1966,11 @@ namespace bgfx { namespace d3d11
{
if (NULL != m_uniforms[_handle.idx])
{
- BX_FREE(g_allocator, m_uniforms[_handle.idx]);
+ bx::free(g_allocator, m_uniforms[_handle.idx]);
}
const uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16);
- void* data = BX_ALLOC(g_allocator, size);
+ void* data = bx::alloc(g_allocator, size);
bx::memSet(data, 0, size);
m_uniforms[_handle.idx] = data;
m_uniformReg.add(_handle, _name);
@@ -1975,7 +1978,7 @@ namespace bgfx { namespace d3d11
void destroyUniform(UniformHandle _handle) override
{
- BX_FREE(g_allocator, m_uniforms[_handle.idx]);
+ bx::free(g_allocator, m_uniforms[_handle.idx]);
m_uniforms[_handle.idx] = NULL;
m_uniformReg.remove(_handle);
}
@@ -2396,7 +2399,7 @@ namespace bgfx { namespace d3d11
&& (m_scd.nwh != g_platformData.nwh || m_scd.ndt != g_platformData.ndt))
{
// Remove swap chain from SwapChainPanel (nwh) if applicable
- m_dxgi.removeSwapChain(m_scd, &m_swapChain);
+ m_dxgi.removeSwapChain(m_scd);
// Update nwh after removing swap chain
m_scd.nwh = g_platformData.nwh;
m_scd.ndt = g_platformData.ndt;
@@ -2511,7 +2514,7 @@ namespace bgfx { namespace d3d11
#if BX_PLATFORM_WINRT
// Remove swap chain from SwapChainPanel (nwh) if applicable
- m_dxgi.removeSwapChain(m_scd, &m_swapChain);
+ m_dxgi.removeSwapChain(m_scd);
#endif
DX_RELEASE(m_swapChain, 0);
HRESULT hr = m_dxgi.createSwapChain(m_device
@@ -3643,7 +3646,7 @@ namespace bgfx { namespace d3d11
s_renderD3D11 = BX_NEW(g_allocator, RendererContextD3D11);
if (!s_renderD3D11->init(_init) )
{
- BX_DELETE(g_allocator, s_renderD3D11);
+ bx::deleteObject(g_allocator, s_renderD3D11);
s_renderD3D11 = NULL;
}
return s_renderD3D11;
@@ -3652,7 +3655,7 @@ namespace bgfx { namespace d3d11
void rendererDestroy()
{
s_renderD3D11->shutdown();
- BX_DELETE(g_allocator, s_renderD3D11);
+ bx::deleteObject(g_allocator, s_renderD3D11);
s_renderD3D11 = NULL;
}
@@ -4449,7 +4452,7 @@ namespace bgfx { namespace d3d11
if (convert)
{
uint32_t srcpitch = mip.m_width*bpp/8;
- temp = (uint8_t*)BX_ALLOC(g_allocator, srcpitch*mip.m_height);
+ temp = (uint8_t*)bx::alloc(g_allocator, srcpitch*mip.m_height);
bimg::imageDecodeToBgra8(g_allocator, temp, mip.m_data, mip.m_width, mip.m_height, srcpitch, mip.m_format);
srd[kk].pSysMem = temp;
@@ -4467,17 +4470,17 @@ namespace bgfx { namespace d3d11
switch (m_textureFormat)
{
case TextureFormat::R5G6B5:
- temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height);
+ temp = (uint8_t*)bx::alloc(g_allocator, srd[kk].SysMemPitch*mip.m_height);
bimg::imageConvert(temp, 16, bx::packB5G6R5, mip.m_data, bx::unpackR5G6B5, srd[kk].SysMemPitch*mip.m_height);
srd[kk].pSysMem = temp;
break;
case TextureFormat::RGBA4:
- temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height);
+ temp = (uint8_t*)bx::alloc(g_allocator, srd[kk].SysMemPitch*mip.m_height);
bimg::imageConvert(temp, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, srd[kk].SysMemPitch*mip.m_height);
srd[kk].pSysMem = temp;
break;
case TextureFormat::RGB5A1:
- temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height);
+ temp = (uint8_t*)bx::alloc(g_allocator, srd[kk].SysMemPitch*mip.m_height);
bimg::imageConvert(temp, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, srd[kk].SysMemPitch*mip.m_height);
srd[kk].pSysMem = temp;
break;
@@ -4713,7 +4716,7 @@ namespace bgfx { namespace d3d11
{
for (uint32_t lod = 0, num = ti.numMips; lod < num; ++lod)
{
- BX_FREE(g_allocator, const_cast<void*>(srd[kk].pSysMem) );
+ bx::free(g_allocator, const_cast<void*>(srd[kk].pSysMem) );
++kk;
}
}
@@ -4801,7 +4804,7 @@ namespace bgfx { namespace d3d11
if (convert)
{
- temp = (uint8_t*)BX_ALLOC(g_allocator, slicepitch);
+ temp = (uint8_t*)bx::alloc(g_allocator, slicepitch);
bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) );
data = temp;
@@ -4820,7 +4823,7 @@ namespace bgfx { namespace d3d11
if (NULL != temp)
{
- BX_FREE(g_allocator, temp);
+ bx::free(g_allocator, temp);
}
}