|
|
@@ -968,7 +968,10 @@ namespace bgfx { namespace mtl
|
|
|
|
|
|
void destroy()
|
|
|
{
|
|
|
- MTL_RELEASE(m_ptr);
|
|
|
+ if (0 == (m_flags & BGFX_SAMPLER_INTERNAL_SHARED))
|
|
|
+ {
|
|
|
+ MTL_RELEASE(m_ptr);
|
|
|
+ }
|
|
|
MTL_RELEASE(m_ptrStencil);
|
|
|
for (uint32_t ii = 0; ii < m_numMips; ++ii)
|
|
|
{
|
|
|
@@ -976,6 +979,13 @@ namespace bgfx { namespace mtl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ void overrideInternal(uintptr_t _ptr)
|
|
|
+ {
|
|
|
+ destroy();
|
|
|
+ m_flags |= BGFX_SAMPLER_INTERNAL_SHARED;
|
|
|
+ m_ptr = id<MTLTexture>(_ptr);
|
|
|
+ }
|
|
|
+
|
|
|
void update(
|
|
|
uint8_t _side
|
|
|
, uint8_t _mip
|