You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Migrating back to using UniformBuffer structs.
Since the cbuffer uses the same name as the struct, we have to rename the cbuffer using a consistent prefix. The reflection handling also needs to reinterpret the renamed cbuffer as the correct UniformBuffer. #jira none #rb kenzo.terelst #preflight 625edc5f034d8924cdcc35e2 [CL 19813742 by christopher waters in ue5-main branch]
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "HlslccDefinitions.h"
|
||||
#include "HAL/FileManager.h"
|
||||
#include "ShaderParameters.h"
|
||||
|
||||
IMPLEMENT_MODULE(FDefaultModuleImpl, ShaderCompilerCommon);
|
||||
|
||||
@@ -469,6 +470,13 @@ TCHAR* FindNextUniformBufferReference(TCHAR* SearchPtr, const TCHAR* SearchStrin
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FString UE::ShaderCompilerCommon::SanitizeUniformBufferName(const FString& InName)
|
||||
{
|
||||
FString NewName(InName);
|
||||
NewName.RemoveFromStart(UE::ShaderParameters::kUniformBufferConstantBufferPrefix);
|
||||
return NewName;
|
||||
}
|
||||
|
||||
void HandleReflectedGlobalConstantBufferMember(
|
||||
const FString& MemberName,
|
||||
uint32 ConstantBufferIndex,
|
||||
@@ -518,8 +526,10 @@ void HandleReflectedUniformBuffer(
|
||||
FShaderCompilerOutput& CompilerOutput
|
||||
)
|
||||
{
|
||||
FString AdjustedUniformBufferName(UE::ShaderCompilerCommon::SanitizeUniformBufferName(UniformBufferName));
|
||||
|
||||
CompilerOutput.ParameterMap.AddParameterAllocation(
|
||||
*UniformBufferName,
|
||||
*AdjustedUniformBufferName,
|
||||
ReflectionSlot,
|
||||
BaseIndex,
|
||||
BufferSize,
|
||||
|
||||
Reference in New Issue
Block a user