Update old Float1010102 to FloatR10G10B10A2

This commit is contained in:
Wojtek Figat
2025-01-12 21:22:53 +01:00
parent d751c6a6c6
commit ea96418764
6 changed files with 22 additions and 23 deletions

View File

@@ -6,7 +6,6 @@
#include "ModelInstanceEntry.h"
#include "Engine/Content/Assets/Material.h"
#include "Engine/Content/Assets/Model.h"
#include "Engine/Core/Log.h"
#include "Engine/Graphics/GPUContext.h"
#include "Engine/Graphics/GPUDevice.h"
#include "Engine/Graphics/RenderTask.h"

View File

@@ -77,8 +77,8 @@ PACK_STRUCT(struct DEPRECATED("Use new MeshAccessor and depend on GPUVertexLayou
{
Float3 Position;
Half2 TexCoord;
Float1010102 Normal;
Float1010102 Tangent;
FloatR10G10B10A2 Normal;
FloatR10G10B10A2 Tangent;
Half2 LightmapUVs;
Color32 Color;
});
@@ -113,8 +113,8 @@ PACK_STRUCT(struct DEPRECATED("Use new MeshAccessor and depend on GPUVertexLayou
PACK_STRUCT(struct DEPRECATED("Use new MeshAccessor and depend on GPUVertexLayout when accessing mesh data.") VB1ElementType18
{
Half2 TexCoord;
Float1010102 Normal;
Float1010102 Tangent;
FloatR10G10B10A2 Normal;
FloatR10G10B10A2 Tangent;
Half2 LightmapUVs;
static GPUVertexLayout* GetLayout();
@@ -143,8 +143,8 @@ PACK_STRUCT(struct DEPRECATED("Use new MeshAccessor and depend on GPUVertexLayou
{
Float3 Position;
Half2 TexCoord;
Float1010102 Normal;
Float1010102 Tangent;
FloatR10G10B10A2 Normal;
FloatR10G10B10A2 Tangent;
Color32 BlendIndices;
Color32 BlendWeights;
});
@@ -171,8 +171,8 @@ PACK_STRUCT(struct DEPRECATED("Use newer format.") VB0SkinnedElementType1
{
Float3 Position;
Half2 TexCoord;
Float1010102 Normal;
Float1010102 Tangent;
FloatR10G10B10A2 Normal;
FloatR10G10B10A2 Tangent;
Color32 BlendIndices;
Color32 BlendWeights;
});
@@ -182,8 +182,8 @@ PACK_STRUCT(struct DEPRECATED("Use new MeshAccessor and depend on GPUVertexLayou
{
Float3 Position;
Half2 TexCoord;
Float1010102 Normal;
Float1010102 Tangent;
FloatR10G10B10A2 Normal;
FloatR10G10B10A2 Tangent;
Color32 BlendIndices;
Half4 BlendWeights;

View File

@@ -1396,14 +1396,14 @@ static PixelFormatSampler PixelFormatSamplers[] =
},
{
PixelFormat::R10G10B10A2_UNorm,
sizeof(Float1010102),
sizeof(FloatR10G10B10A2),
[](const void* ptr)
{
return ((Float1010102*)ptr)->ToFloat4();
return ((FloatR10G10B10A2*)ptr)->ToFloat4();
},
[](void* ptr, const Float4& value)
{
*(Float1010102*)ptr = Float1010102(value.X, value.Y, value.Z, value.W);
*(FloatR10G10B10A2*)ptr = FloatR10G10B10A2(value.X, value.Y, value.Z, value.W);
},
},
{

View File

@@ -562,8 +562,8 @@ void RenderTools::CalculateTangentFrame(FloatR10G10B10A2& resultNormal, FloatR10
Float3 n;
Float4 t;
CalculateTangentFrame(n, t, normal);
resultNormal = Float1010102(n, 0);
resultTangent = Float1010102(t);
resultNormal = FloatR10G10B10A2(n, 0);
resultTangent = FloatR10G10B10A2(t);
}
void RenderTools::CalculateTangentFrame(FloatR10G10B10A2& resultNormal, FloatR10G10B10A2& resultTangent, const Float3& normal, const Float3& tangent)
@@ -572,8 +572,8 @@ void RenderTools::CalculateTangentFrame(FloatR10G10B10A2& resultNormal, FloatR10
Float3 n;
Float4 t;
CalculateTangentFrame(n, t, normal, tangent);
resultNormal = Float1010102(n, 0);
resultTangent = Float1010102(t);
resultNormal = FloatR10G10B10A2(n, 0);
resultTangent = FloatR10G10B10A2(t);
}
void RenderTools::CalculateTangentFrame(Float3& resultNormal, Float4& resultTangent, const Float3& normal)