Remove "has bone" specialization constant.

This commit is contained in:
Skyth 2024-11-26 23:24:09 +03:00
parent c261a0ef9c
commit f3f8df0053
2 changed files with 4 additions and 27 deletions

View file

@ -2736,9 +2736,7 @@ static RenderPipeline* CreateGraphicsPipelineInRenderThread(PipelineState pipeli
pipeline = CreateGraphicsPipeline(pipelineState); pipeline = CreateGraphicsPipeline(pipelineState);
#ifdef ASYNC_PSO_DEBUG #ifdef ASYNC_PSO_DEBUG
if (pipelineState.zEnable) // Should ignore most post effect/2D shaders. ++g_pipelinesCreatedInRenderThread;
++g_pipelinesCreatedInRenderThread;
pipeline->setName(std::format("Render Thread Pipeline {:X}", hash)); pipeline->setName(std::format("Render Thread Pipeline {:X}", hash));
#endif #endif
} }
@ -2866,15 +2864,6 @@ static void FlushRenderStateForMainThread(GuestDevice* device, LocalRenderComman
static void ProcSetBooleans(const RenderCommand& cmd) static void ProcSetBooleans(const RenderCommand& cmd)
{ {
SetDirtyValue(g_dirtyStates.sharedConstants, g_sharedConstants.booleans, cmd.setBooleans.booleans); SetDirtyValue(g_dirtyStates.sharedConstants, g_sharedConstants.booleans, cmd.setBooleans.booleans);
// mrgHasBone
uint32_t specConstants = g_pipelineState.specConstants;
if ((cmd.setBooleans.booleans & 0x1) != 0)
specConstants |= SPEC_CONSTANT_HAS_BONE;
else
specConstants &= ~SPEC_CONSTANT_HAS_BONE;
SetDirtyValue(g_dirtyStates.pipelineState, g_pipelineState.specConstants, specConstants);
} }
static void ProcSetSamplerState(const RenderCommand& cmd) static void ProcSetSamplerState(const RenderCommand& cmd)
@ -4320,7 +4309,6 @@ static void CreateGraphicsPipelineInPipelineThread(const PipelineState& pipeline
struct CompilationArgs struct CompilationArgs
{ {
bool hasBone;
bool noGI; bool noGI;
}; };
@ -4379,9 +4367,6 @@ static void CompileMeshPipeline(Hedgehog::Mirage::CMeshData* mesh, MeshLayer lay
pipelineState.vertexStrides[0] = mesh->m_VertexSize; pipelineState.vertexStrides[0] = mesh->m_VertexSize;
pipelineState.depthStencilFormat = RenderFormat::D32_FLOAT; pipelineState.depthStencilFormat = RenderFormat::D32_FLOAT;
if (args.hasBone)
pipelineState.specConstants |= SPEC_CONSTANT_HAS_BONE;
if (layer == MeshLayer::PunchThrough) if (layer == MeshLayer::PunchThrough)
pipelineState.specConstants |= SPEC_CONSTANT_ALPHA_TEST; pipelineState.specConstants |= SPEC_CONSTANT_ALPHA_TEST;
@ -4443,9 +4428,6 @@ static void CompileMeshPipeline(Hedgehog::Mirage::CMeshData* mesh, MeshLayer lay
if (pipelineState.vertexDeclaration->hasR11G11B10Normal) if (pipelineState.vertexDeclaration->hasR11G11B10Normal)
pipelineState.specConstants |= SPEC_CONSTANT_R11G11B10_NORMAL; pipelineState.specConstants |= SPEC_CONSTANT_R11G11B10_NORMAL;
if (args.hasBone)
pipelineState.specConstants |= SPEC_CONSTANT_HAS_BONE;
if (Config::GITextureFiltering == EGITextureFiltering::Bicubic) if (Config::GITextureFiltering == EGITextureFiltering::Bicubic)
pipelineState.specConstants |= SPEC_CONSTANT_BICUBIC_GI_FILTER; pipelineState.specConstants |= SPEC_CONSTANT_BICUBIC_GI_FILTER;
@ -4525,14 +4507,9 @@ static void PipelineCompilerThread()
} }
if (databaseData->m_pVftable.ptr == TERRAIN_MODEL_DATA_VFTABLE) if (databaseData->m_pVftable.ptr == TERRAIN_MODEL_DATA_VFTABLE)
{ CompileMeshPipelines(*reinterpret_cast<Hedgehog::Mirage::CTerrainModelData*>(databaseData.get()), { false });
CompileMeshPipelines(*reinterpret_cast<Hedgehog::Mirage::CTerrainModelData*>(databaseData.get()), { false, false });
}
else else
{ CompileMeshPipelines(*reinterpret_cast<Hedgehog::Mirage::CModelData*>(databaseData.get()), { true });
auto modelData = reinterpret_cast<Hedgehog::Mirage::CModelData*>(databaseData.get());
CompileMeshPipelines(*modelData, { modelData->m_NodeNum > 1, true });
}
databaseData->m_Flags &= ~eDatabaseDataFlags_CompilingPipelines; databaseData->m_Flags &= ~eDatabaseDataFlags_CompilingPipelines;

@ -1 +1 @@
Subproject commit 31513fbfbbd91a2062c700e4ac060bd0e92b6f2e Subproject commit bd9872894411060e8b72c8eada341406a350d21d