52 lines
1.2 KiB
HLSL
52 lines
1.2 KiB
HLSL
|
|
typedef float4 PositionData;
|
|
typedef float2 UVData;
|
|
typedef float4 NormalData;
|
|
|
|
struct MaterialData
|
|
{
|
|
float4 m_AlbedoFactor;
|
|
float3 m_EmissionFactor;
|
|
float m_MetalFactor;
|
|
float m_RoughFactor;
|
|
uint m_AlbedoTex;
|
|
uint m_NormalTex;
|
|
uint m_MetalRoughTex;
|
|
uint m_OcclusionTex;
|
|
uint m_EmissionTex;
|
|
};
|
|
|
|
struct Block
|
|
{
|
|
uint vertexBufferHandle;
|
|
uint uvBufferHandle;
|
|
uint materialBufferHandle;
|
|
uint m_VertexOffset;
|
|
int m_NormalOffset;
|
|
int m_TexCoord0Offset;
|
|
uint m_FirstIndex;
|
|
uint m_IndexCount;
|
|
int m_MaterialIdx;
|
|
};
|
|
|
|
struct Camera
|
|
{
|
|
row_major float4x4 model;
|
|
row_major float4x4 view;
|
|
row_major float4x4 proj;
|
|
};
|
|
|
|
#define INVALID_HANDLE 0xFFFFFFFF
|
|
|
|
[[vk::binding(0, 0)]] StructuredBuffer<PositionData> vertexBuffer[];
|
|
[[vk::binding(0, 0)]] StructuredBuffer<UVData> uvBuffer[];
|
|
[[vk::binding(0, 0)]] StructuredBuffer<NormalData> normalBuffer[];
|
|
[[vk::binding(0, 0)]] StructuredBuffer<MaterialData> materialsBuffer[];
|
|
|
|
[[vk::binding(1, 0)]] Texture2D<float4> textures[];
|
|
[[vk::binding(1, 0)]] SamplerState immutableSamplers[];
|
|
|
|
[[vk::binding(0, 1)]] ConstantBuffer<Camera> camera;
|
|
|
|
[[vk::push_constant]]
|
|
Block pcb; |