Skip to content

Commit

Permalink
Archiver Mtl: added vertex input attribute remapping
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Dec 25, 2023
1 parent f8321d6 commit fab0669
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Graphics/Archiver/src/Archiver_Mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,22 @@ SerializedData CompileMtlShader(const CompileMtlShaderAttribs& Attribs) noexcept
PSOName},
ResRemapping); // may throw exception

if (ShDesc.ShaderType == SHADER_TYPE_PIXEL && Attribs.pRenderPass != nullptr)
if (ShDesc.ShaderType == SHADER_TYPE_VERTEX)
{
// Remap vertex input attributes
PipelineStateMtlImpl::GetVSInputMap({
ParsedMsl,
MslData
},
ResRemapping);
}
else if (ShDesc.ShaderType == SHADER_TYPE_PIXEL && Attribs.pRenderPass != nullptr)
{
const auto& RPDesc = Attribs.pRenderPass->GetDesc();
const auto& Features = Attribs.pSerializationDevice->GetDeviceInfo().Features;

RenderPassMtlImpl RenderPassMtl{RPDesc, Features};
PipelineStateMtlImpl::GetInputOutputMap({
PipelineStateMtlImpl::GetPSInputOutputMap({
ParsedMsl,
RenderPassMtl,
ShDesc,
Expand Down

0 comments on commit fab0669

Please sign in to comment.