- Added `<IsTrimmable>` property in project files for trimming. - Replaced bindless texture types with non-bindless equivalents. - Refactored `ShaderDescriptor` and `ShaderPass` for better modularity. - Introduced `ShaderDescriptorExtensions` for property size calculations. - Simplified constant buffer handling in `Material.cs`. - Improved resource management in `D3D12` components. - Added support for static meshes and optimized resource barriers. - Refactored shader code generation and property merging in `SDLCompiler`. - Removed unused or redundant code (e.g., `IncludesBlock` parser). - Updated comments, documentation, and error handling for clarity.
51 lines
1.3 KiB
HLSL
51 lines
1.3 KiB
HLSL
#ifndef BUILTIN_PROPERTIES_HLSL
|
|
#define BUILTIN_PROPERTIES_HLSL
|
|
|
|
#include "F:/csharp/GhostEngine/Ghost.Shader/BuiltIn/Common.hlsl"
|
|
|
|
struct PerViewData
|
|
{
|
|
float4x4 cameraMatrix;
|
|
float4x4 cameraInverseMatrix;
|
|
float4 screenSize; // xy = size, zw = 1/size
|
|
};
|
|
|
|
struct PerObjectData
|
|
{
|
|
float4x4 localToWorld;
|
|
float3 worldBoundsMin;
|
|
BYTE_ADDRESS_BUFFER_BINDLESS vertexBuffer;
|
|
float3 worldBoundsMax;
|
|
BYTE_ADDRESS_BUFFER_BINDLESS indexBuffer;
|
|
};
|
|
|
|
cbuffer GlobalConstants : register(b0)
|
|
{
|
|
GlobalData g_GlobalData;
|
|
};
|
|
|
|
cbuffer PerViewConstants : register(b1)
|
|
{
|
|
PerViewData g_PerViewData;
|
|
};
|
|
|
|
cbuffer PerObjectConstants : register(b2)
|
|
{
|
|
PerObjectData g_PerObjectData;
|
|
};
|
|
|
|
cbuffer PerMaterialConstants : register(b3)
|
|
{
|
|
PerMaterialData g_PerMaterialData;
|
|
};
|
|
|
|
#if defined(USE_TRADITIONAL_BINDLESS)
|
|
Texture2D GlobalTexture2DHeap[GLOBAL_TEXTURE2D_HEAP_SIZE] : register(t0);
|
|
Texture3D GlobalTexture3DHeap[GLOBAL_TEXTURE3D_HEAP_SIZE] : register(t0);
|
|
TextureCube GlobalTextureCubeHeap[GLOBAL_TEXTURECUBE_HEAP_SIZE] : register(t0);
|
|
Texture2DArray GlobalTexture2DArrayHeap[GLOBAL_TEXTURE2D_ARRAY_HEAP_SIZE] : register(t0);
|
|
TextureCubeArray GlobalTextureCubeArrayHeap[GLOBAL_TEXTURECUBE_ARRAY_HEAP_SIZE] : register(t0);
|
|
SamplerState GlobalSamplerHeap[GLOBAL_SAMPLER_HEAP_SIZE] : register(s0);
|
|
#endif
|
|
|
|
#endif // BUILTIN_PROPERTIES_HLSL |