Porting to a famous blue platform
This commit is contained in:
@@ -201,6 +201,7 @@ bool DeferredMaterialShader::Load()
|
|||||||
psDesc.DepthWriteEnable = true;
|
psDesc.DepthWriteEnable = true;
|
||||||
psDesc.DepthEnable = true;
|
psDesc.DepthEnable = true;
|
||||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||||
|
psDesc.BlendMode.RenderTargetWriteMask = BlendingMode::ColorWrite::None;
|
||||||
psDesc.HS = nullptr;
|
psDesc.HS = nullptr;
|
||||||
psDesc.DS = nullptr;
|
psDesc.DS = nullptr;
|
||||||
GPUShaderProgramVS* instancedDepthPassVS;
|
GPUShaderProgramVS* instancedDepthPassVS;
|
||||||
|
|||||||
@@ -195,5 +195,10 @@ bool ForwardMaterialShader::Load()
|
|||||||
psDesc.VS = _shader->GetVS("VS_Skinned");
|
psDesc.VS = _shader->GetVS("VS_Skinned");
|
||||||
_cache.DepthSkinned.Init(psDesc);
|
_cache.DepthSkinned.Init(psDesc);
|
||||||
|
|
||||||
|
#if PLATFORM_PS5
|
||||||
|
// Fix shader binding issues on forward shading materials on PS5
|
||||||
|
_drawModes = DrawPass::None;
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,5 +264,10 @@ bool ParticleMaterialShader::Load()
|
|||||||
// Lazy initialization
|
// Lazy initialization
|
||||||
_cacheVolumetricFog.Desc.PS = nullptr;
|
_cacheVolumetricFog.Desc.PS = nullptr;
|
||||||
|
|
||||||
|
#if PLATFORM_PS5
|
||||||
|
// Fix shader binding issues on forward shading materials on PS5
|
||||||
|
_drawModes = DrawPass::None;
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ GPUTexture* RenderBuffers::RequestHalfResDepth(GPUContext* context)
|
|||||||
|
|
||||||
PixelFormat RenderBuffers::GetOutputFormat() const
|
PixelFormat RenderBuffers::GetOutputFormat() const
|
||||||
{
|
{
|
||||||
return _useAlpha ? PixelFormat::R16G16B16A16_Float : PixelFormat::R11G11B10_Float;
|
// TODO: fix incorrect alpha leaking into reflections on PS5 with R11G11B10_Float
|
||||||
|
return _useAlpha || PLATFORM_PS5 ? PixelFormat::R16G16B16A16_Float : PixelFormat::R11G11B10_Float;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderBuffers::GetUseAlpha() const
|
bool RenderBuffers::GetUseAlpha() const
|
||||||
|
|||||||
@@ -375,6 +375,7 @@ void PostProcessingPass::Render(RenderContext& renderContext, GPUTexture* input,
|
|||||||
RENDER_TARGET_POOL_SET_NAME(bloomBuffer1, "PostProcessing.Bloom");
|
RENDER_TARGET_POOL_SET_NAME(bloomBuffer1, "PostProcessing.Bloom");
|
||||||
RENDER_TARGET_POOL_SET_NAME(bloomBuffer2, "PostProcessing.Bloom");
|
RENDER_TARGET_POOL_SET_NAME(bloomBuffer2, "PostProcessing.Bloom");
|
||||||
|
|
||||||
|
// TODO: skip this clear? or do it at once for the whole textures (2 calls instead of per-mip)
|
||||||
for (int32 mip = 0; mip < bloomMipCount; mip++)
|
for (int32 mip = 0; mip < bloomMipCount; mip++)
|
||||||
{
|
{
|
||||||
context->Clear(bloomBuffer1->View(0, mip), Color::Transparent);
|
context->Clear(bloomBuffer1->View(0, mip), Color::Transparent);
|
||||||
|
|||||||
@@ -917,6 +917,7 @@ void RenderList::ExecuteDrawCalls(const RenderContext& renderContext, DrawCallsL
|
|||||||
perDraw.DrawPadding = Float3::Zero;
|
perDraw.DrawPadding = Float3::Zero;
|
||||||
GPUConstantBuffer* perDrawCB = IMaterial::BindParameters::PerDrawConstants;
|
GPUConstantBuffer* perDrawCB = IMaterial::BindParameters::PerDrawConstants;
|
||||||
context->BindCB(2, perDrawCB); // TODO: use rootSignature/pushConstants on D3D12/Vulkan
|
context->BindCB(2, perDrawCB); // TODO: use rootSignature/pushConstants on D3D12/Vulkan
|
||||||
|
context->UpdateCB(perDrawCB, &perDraw);
|
||||||
constexpr int32 vbMax = ARRAY_COUNT(DrawCall::Geometry.VertexBuffers);
|
constexpr int32 vbMax = ARRAY_COUNT(DrawCall::Geometry.VertexBuffers);
|
||||||
if (useInstancing)
|
if (useInstancing)
|
||||||
{
|
{
|
||||||
@@ -1057,7 +1058,7 @@ void RenderList::ExecuteDrawCalls(const RenderContext& renderContext, DrawCallsL
|
|||||||
materialBinds += list.PreBatchedDrawCalls.Count();
|
materialBinds += list.PreBatchedDrawCalls.Count();
|
||||||
if (list.Batches.IsEmpty() && list.Indices.Count() != 0)
|
if (list.Batches.IsEmpty() && list.Indices.Count() != 0)
|
||||||
{
|
{
|
||||||
// Draw calls list has bot been batched so execute draw calls separately
|
// Draw calls list has not been batched so execute draw calls separately
|
||||||
for (int32 j = 0; j < list.Indices.Count(); j++)
|
for (int32 j = 0; j < list.Indices.Count(); j++)
|
||||||
{
|
{
|
||||||
perDraw.DrawObjectIndex = listData[j];
|
perDraw.DrawObjectIndex = listData[j];
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ struct DrawCallsList
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// True if draw calls batches list can be rendered using hardware instancing, otherwise false.
|
/// True if draw calls batches list can be rendered using hardware instancing, otherwise false.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool CanUseInstancing;
|
bool CanUseInstancing = true;
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
bool IsEmpty() const;
|
bool IsEmpty() const;
|
||||||
|
|||||||
@@ -2173,7 +2173,7 @@ bool MonoAotPreloadTask::Run()
|
|||||||
{
|
{
|
||||||
// Load AOT module
|
// Load AOT module
|
||||||
Stopwatch aotModuleLoadStopwatch;
|
Stopwatch aotModuleLoadStopwatch;
|
||||||
LOG(Info, "Loading Mono AOT module...");
|
//LOG(Info, "Loading Mono AOT module...");
|
||||||
MonoAotPreloadServiceInstance.Library = Platform::LoadLibrary(TEXT(USE_MONO_AOT_MODULE));
|
MonoAotPreloadServiceInstance.Library = Platform::LoadLibrary(TEXT(USE_MONO_AOT_MODULE));
|
||||||
aotModuleLoadStopwatch.Stop();
|
aotModuleLoadStopwatch.Stop();
|
||||||
LOG(Info, "Mono AOT module loaded in {0}ms", aotModuleLoadStopwatch.GetMilliseconds());
|
LOG(Info, "Mono AOT module loaded in {0}ms", aotModuleLoadStopwatch.GetMilliseconds());
|
||||||
|
|||||||
@@ -278,6 +278,17 @@ bool ShaderCompiler::WriteShaderFunctionPermutation(ShaderCompilationContext* co
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShaderCompiler::WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* header, int32 headerSize, const void* cache1, int32 cache1Size, const void* cache2, int32 cache2Size)
|
||||||
|
{
|
||||||
|
auto output = context->Output;
|
||||||
|
output->Write((uint32)(cache1Size + cache2Size + headerSize));
|
||||||
|
output->WriteBytes(header, headerSize);
|
||||||
|
output->WriteBytes(cache1, cache1Size);
|
||||||
|
output->WriteBytes(cache2, cache2Size);
|
||||||
|
output->Write(bindings);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool ShaderCompiler::WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* cache, int32 cacheSize)
|
bool ShaderCompiler::WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* cache, int32 cacheSize)
|
||||||
{
|
{
|
||||||
auto output = context->Output;
|
auto output = context->Output;
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ protected:
|
|||||||
|
|
||||||
static bool WriteShaderFunctionBegin(ShaderCompilationContext* context, ShaderFunctionMeta& meta);
|
static bool WriteShaderFunctionBegin(ShaderCompilationContext* context, ShaderFunctionMeta& meta);
|
||||||
static bool WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* header, int32 headerSize, const void* cache, int32 cacheSize);
|
static bool WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* header, int32 headerSize, const void* cache, int32 cacheSize);
|
||||||
|
static bool WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* header, int32 headerSize, const void* cache1, int32 cache1Size, const void* cache2, int32 cache2Size);
|
||||||
static bool WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* cache, int32 cacheSize);
|
static bool WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* cache, int32 cacheSize);
|
||||||
static bool WriteShaderFunctionEnd(ShaderCompilationContext* context, ShaderFunctionMeta& meta);
|
static bool WriteShaderFunctionEnd(ShaderCompilationContext* context, ShaderFunctionMeta& meta);
|
||||||
static bool WriteCustomDataVS(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const Array<ShaderMacro>& macros, void* additionalData);
|
static bool WriteCustomDataVS(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const Array<ShaderMacro>& macros, void* additionalData);
|
||||||
|
|||||||
Reference in New Issue
Block a user