summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/renderer_mtl.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/renderer_mtl.h')
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/3rdparty/bgfx/src/renderer_mtl.h b/3rdparty/bgfx/src/renderer_mtl.h
index 1ceba862ca3..e22875a5f95 100644
--- a/3rdparty/bgfx/src/renderer_mtl.h
+++ b/3rdparty/bgfx/src/renderer_mtl.h
@@ -62,7 +62,6 @@ namespace bgfx { namespace mtl
#endif
}
-
// c++ wrapper
// objects with creation functions starting with 'new' has a refcount 1 after creation, object must be destroyed with release.
// commandBuffer, commandEncoders are autoreleased objects. Needs AutoreleasePool!
@@ -251,8 +250,11 @@ namespace bgfx { namespace mtl
[m_obj dispatchThreadgroups:_threadgroupsPerGrid threadsPerThreadgroup:_threadsPerThreadgroup];
}
- void dispatchThreadgroupsWithIndirectBuffer(id <MTLBuffer> _indirectBuffer,
- NSUInteger _indirectBufferOffset, MTLSize _threadsPerThreadgroup)
+ void dispatchThreadgroupsWithIndirectBuffer(
+ id <MTLBuffer> _indirectBuffer
+ , NSUInteger _indirectBufferOffset
+ , MTLSize _threadsPerThreadgroup
+ )
{
[m_obj dispatchThreadgroupsWithIndirectBuffer:_indirectBuffer indirectBufferOffset:_indirectBufferOffset threadsPerThreadgroup:_threadsPerThreadgroup];
}
@@ -274,9 +276,9 @@ namespace bgfx { namespace mtl
MTL_CLASS_END
MTL_CLASS(Device)
- bool supportsFeatureSet(MTLFeatureSet _featureSet)
+ bool supportsFamily(MTLGPUFamily _featureSet)
{
- return [m_obj supportsFeatureSet:_featureSet];
+ return [m_obj supportsFamily:_featureSet];
}
id<MTLLibrary> newLibraryWithData(const void* _data)
@@ -727,11 +729,11 @@ namespace bgfx { namespace mtl
return [_str UTF8String];
}
-#define MTL_RELEASE(_obj) \
- BX_MACRO_BLOCK_BEGIN \
- [_obj release]; \
- _obj = nil; \
- BX_MACRO_BLOCK_END
+#define MTL_RELEASE(_obj) \
+ BX_MACRO_BLOCK_BEGIN \
+ [_obj release]; \
+ _obj = NULL; \
+ BX_MACRO_BLOCK_END
// end of c++ wrapper
@@ -803,7 +805,7 @@ namespace bgfx { namespace mtl
if (NULL != m_dynamic)
{
- BX_DELETE(g_allocator, m_dynamic);
+ bx::deleteObject(g_allocator, m_dynamic);
m_dynamic = NULL;
}
}
@@ -938,7 +940,7 @@ namespace bgfx { namespace mtl
void release(PipelineStateMtl* _ptr)
{
- BX_DELETE(g_allocator, _ptr);
+ bx::deleteObject(g_allocator, _ptr);
}
struct TextureMtl
@@ -974,6 +976,7 @@ namespace bgfx { namespace mtl
if (0 == (m_flags & BGFX_SAMPLER_INTERNAL_SHARED))
{
MTL_RELEASE(m_ptr);
+ MTL_RELEASE(m_ptrMsaa);
}
MTL_RELEASE(m_ptrStencil);
for (uint32_t ii = 0; ii < m_numMips; ++ii)
@@ -1159,7 +1162,7 @@ namespace bgfx { namespace mtl
uint64_t m_elapsed;
uint64_t m_frequency;
- Result m_result[4*2];
+ Result m_result[BGFX_CONFIG_MAX_VIEWS+1];
bx::RingBufferControl m_control;
};