fix image is not set in pipeline state object in metal renderer (#2780)
* always set pipeline state object 'm_bindingTypes' when argument is texture * fix the typo error casue cash
This commit is contained in:
parent
f6e0db1969
commit
2568ce7311
@ -2016,11 +2016,6 @@ namespace bgfx { namespace mtl
|
|||||||
else if (arg.type == MTLArgumentTypeTexture)
|
else if (arg.type == MTLArgumentTypeTexture)
|
||||||
{
|
{
|
||||||
const char* name = utf8String(arg.name);
|
const char* name = utf8String(arg.name);
|
||||||
const UniformRegInfo* info = s_renderMtl->m_uniformReg.find(name);
|
|
||||||
BX_WARN(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name);
|
|
||||||
|
|
||||||
if (NULL != info)
|
|
||||||
{
|
|
||||||
if (arg.index >= BGFX_CONFIG_MAX_TEXTURE_SAMPLERS)
|
if (arg.index >= BGFX_CONFIG_MAX_TEXTURE_SAMPLERS)
|
||||||
{
|
{
|
||||||
BX_WARN(false, "Binding index is too large %d max is %d. User defined uniform '%s' won't be set.", int(arg.index), BGFX_CONFIG_MAX_TEXTURE_SAMPLERS - 1, name);
|
BX_WARN(false, "Binding index is too large %d max is %d. User defined uniform '%s' won't be set.", int(arg.index), BGFX_CONFIG_MAX_TEXTURE_SAMPLERS - 1, name);
|
||||||
@ -2028,8 +2023,15 @@ namespace bgfx { namespace mtl
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ps->m_bindingTypes[arg.index] = fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader;
|
ps->m_bindingTypes[arg.index] = fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader;
|
||||||
|
const UniformRegInfo* info = s_renderMtl->m_uniformReg.find(name);
|
||||||
|
if (info)
|
||||||
|
{
|
||||||
BX_TRACE("texture %s %d index:%d", name, info->m_handle, uint32_t(arg.index) );
|
BX_TRACE("texture %s %d index:%d", name, info->m_handle, uint32_t(arg.index) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BX_TRACE("image %s index:%d", name, uint32_t(arg.index) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (arg.type == MTLArgumentTypeSampler)
|
else if (arg.type == MTLArgumentTypeSampler)
|
||||||
|
Loading…
Reference in New Issue
Block a user