d3c11eddf6
* dx12: initial HDR support * make dx12 more feature level compatible * vulkan, dx12 hdr updates * remove trash * remove postprocess_LDR, tests * fixes * added custom display output mapping for hdr10 * renderpath2d srgb->linear mapping for compose blending * hdr updates * improvements * documentation update * documentation fixes * vulkan: outdated swapchain handling * minor fix * vulkan: hdr workaround with color space change with same format * improved vulkan swapchain destructor * updated features.txt
119 lines
4.0 KiB
C
119 lines
4.0 KiB
C
#ifndef WI_SHADERINTEROP_H
|
|
#define WI_SHADERINTEROP_H
|
|
|
|
#include "ConstantBufferMapping.h"
|
|
#include "SamplerMapping.h"
|
|
#include "ResourceMapping.h"
|
|
|
|
#ifdef __cplusplus // not invoking shader compiler, but included in engine source
|
|
|
|
// Application-side types:
|
|
|
|
typedef XMMATRIX matrix;
|
|
typedef XMFLOAT3X4 float3x4;
|
|
typedef XMFLOAT4X4 float4x4;
|
|
typedef XMFLOAT2 float2;
|
|
typedef XMFLOAT3 float3;
|
|
typedef XMFLOAT4 float4;
|
|
typedef uint32_t uint;
|
|
typedef XMUINT2 uint2;
|
|
typedef XMUINT3 uint3;
|
|
typedef XMUINT4 uint4;
|
|
typedef XMINT2 int2;
|
|
typedef XMINT3 int3;
|
|
typedef XMINT4 int4;
|
|
|
|
#define column_major
|
|
#define row_major
|
|
|
|
#define CB_GETBINDSLOT(name) __CBUFFERBINDSLOT__##name##__
|
|
#define CBUFFER(name, slot) static const int CB_GETBINDSLOT(name) = slot; struct alignas(16) name
|
|
#define CONSTANTBUFFER(name, type, slot)
|
|
#define PUSHCONSTANT(name, type)
|
|
|
|
#else
|
|
|
|
// Shader - side types:
|
|
|
|
#define CBUFFER(name, slot) cbuffer name : register(b ## slot)
|
|
#define CONSTANTBUFFER(name, type, slot) ConstantBuffer< type > name : register(b ## slot)
|
|
|
|
#define RAWBUFFER(name,slot) ByteAddressBuffer name : register(t ## slot)
|
|
#define RWRAWBUFFER(name,slot) RWByteAddressBuffer name : register(u ## slot)
|
|
|
|
#define TYPEDBUFFER(name, type, slot) Buffer< type > name : register(t ## slot)
|
|
#define RWTYPEDBUFFER(name, type, slot) RWBuffer< type > name : register(u ## slot)
|
|
|
|
#define STRUCTUREDBUFFER(name, type, slot) StructuredBuffer< type > name : register(t ## slot)
|
|
#define RWSTRUCTUREDBUFFER(name, type, slot) RWStructuredBuffer< type > name : register(u ## slot)
|
|
#define ROVSTRUCTUREDBUFFER(name, type, slot) RasterizerOrderedStructuredBuffer< type > name : register(u ## slot)
|
|
|
|
|
|
#define TEXTURE1D(name, type, slot) Texture1D< type > name : register(t ## slot)
|
|
#define TEXTURE1DARRAY(name, type, slot) Texture1DArray< type > name : register(t ## slot)
|
|
#define RWTEXTURE1D(name, type, slot) RWTexture1D< type > name : register(u ## slot)
|
|
|
|
#define TEXTURE2D(name, type, slot) Texture2D< type > name : register(t ## slot)
|
|
#define TEXTURE2DMS(name, type, slot) Texture2DMS< type > name : register(t ## slot)
|
|
#define TEXTURE2DARRAY(name, type, slot) Texture2DArray< type > name : register(t ## slot)
|
|
#define RWTEXTURE2D(name, type, slot) RWTexture2D< type > name : register(u ## slot)
|
|
#define RWTEXTURE2DARRAY(name, type, slot) RWTexture2DArray< type > name : register(u ## slot)
|
|
#define ROVTEXTURE2D(name, type, slot) RasterizerOrderedTexture2D< type > name : register(u ## slot)
|
|
|
|
#define TEXTURECUBE(name, type, slot) TextureCube< type > name : register(t ## slot)
|
|
#define TEXTURECUBEARRAY(name, type, slot) TextureCubeArray< type > name : register(t ## slot)
|
|
|
|
#define TEXTURE3D(name, type, slot) Texture3D< type > name : register(t ## slot)
|
|
#define RWTEXTURE3D(name, type, slot) RWTexture3D< type > name : register(u ## slot)
|
|
#define ROVTEXTURE3D(name, type, slot) RasterizerOrderedTexture3D< type > name : register(u ## slot)
|
|
|
|
|
|
#define SAMPLERSTATE(name, slot) SamplerState name : register(s ## slot)
|
|
#define SAMPLERCOMPARISONSTATE(name, slot) SamplerComparisonState name : register(s ## slot)
|
|
|
|
|
|
#if defined(HLSL6) || defined(SPIRV)
|
|
#define BINDLESS
|
|
#define RAYTRACINGACCELERATIONSTRUCTURE(name, slot) RaytracingAccelerationStructure name : register(t ## slot)
|
|
#endif // HLSL6 || SPIRV
|
|
|
|
#ifdef SPIRV
|
|
#define PUSHCONSTANT(name, type) [[vk::push_constant]] type name;
|
|
#endif // SPIRV
|
|
|
|
#ifdef HLSL6
|
|
#define PUSHCONSTANT(name, type) ConstantBuffer<type> name : register(b999)
|
|
#endif // HLSL6
|
|
|
|
#ifdef DISABLE_WAVE_INTRINSICS
|
|
#define WaveReadLaneFirst(a) (a)
|
|
#define WaveActiveBitOr(a) (a)
|
|
#endif // DISABLE_WAVE_INTRINSICS
|
|
|
|
struct IndirectDrawArgsInstanced
|
|
{
|
|
uint VertexCountPerInstance;
|
|
uint InstanceCount;
|
|
uint StartVertexLocation;
|
|
uint StartInstanceLocation;
|
|
};
|
|
struct IndirectDrawArgsIndexedInstanced
|
|
{
|
|
uint IndexCountPerInstance;
|
|
uint InstanceCount;
|
|
uint StartIndexLocation;
|
|
int BaseVertexLocation;
|
|
uint StartInstanceLocation;
|
|
};
|
|
struct IndirectDispatchArgs
|
|
{
|
|
uint ThreadGroupCountX;
|
|
uint ThreadGroupCountY;
|
|
uint ThreadGroupCountZ;
|
|
};
|
|
|
|
#endif // __cplusplus
|
|
|
|
|
|
#endif // WI_SHADERINTEROP_H
|