This commit is contained in:
Branimir Karadžić 2015-10-21 21:23:17 -07:00
parent 000c75539c
commit f6d433f4ff

View file

@ -332,7 +332,6 @@ namespace bgfx { namespace mtl
, m_rtMsaa(false)
, m_drawable(NULL)
{
m_fbh.idx = invalidHandle;
}
~RendererContextMtl()
@ -343,6 +342,10 @@ namespace bgfx { namespace mtl
{
BX_TRACE("Init.");
m_fbh.idx = invalidHandle;
memset(m_uniforms, 0, sizeof(m_uniforms) );
memset(&m_resolution, 0, sizeof(m_resolution) );
if (NULL != NSClassFromString(@"CAMetalLayer") )
{
//on iOS we need the layer as CAmetalLayer
@ -397,8 +400,6 @@ namespace bgfx { namespace mtl
m_uniformBufferVertexOffset = 0;
m_uniformBufferFragmentOffset = 0;
memset(m_uniforms, 0, sizeof(m_uniforms) );
g_caps.supported |= (0
| BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
| BGFX_CAPS_TEXTURE_3D
@ -888,8 +889,14 @@ namespace bgfx { namespace mtl
//TODO: support msaa
if (NULL == m_backBufferDepth
|| width != m_backBufferDepth.width()
|| height != m_backBufferDepth.height() )
|| height != m_backBufferDepth.height()
|| m_resolution.m_width != _resolution.m_width
|| m_resolution.m_height != _resolution.m_height
|| m_resolution.m_flags != _resolution.m_flags)
{
m_resolution = _resolution;
m_resolution.m_flags &= ~BGFX_RESET_FORCE;
m_textureDescriptor.textureType = MTLTextureType2D;
m_textureDescriptor.pixelFormat = MTLPixelFormatDepth32Float_Stencil8;
@ -1220,6 +1227,8 @@ namespace bgfx { namespace mtl
FrameBufferHandle m_fbh;
bool m_rtMsaa;
Resolution m_resolution;
// descriptors
RenderPipelineDescriptor m_renderPipelineDescriptor;
DepthStencilDescriptor m_depthStencilDescriptor;
@ -1858,7 +1867,10 @@ namespace bgfx { namespace mtl
if (srgb)
{
format = s_textureFormat[m_textureFormat].m_fmtSrgb;
BX_WARN(format != MTLPixelFormatInvalid, "sRGB not supported for texture format %d", m_textureFormat);
BX_WARN(format != MTLPixelFormatInvalid
, "sRGB not supported for texture format %d"
, m_textureFormat
);
}
if (format == MTLPixelFormatInvalid)