|
|
|
|
|
|
// Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 |
|
|
|
#define ZERO_INITIALIZE(type, name) name = (type)0; |
|
|
|
|
|
|
|
// Texture util abstraction |
|
|
|
|
|
|
|
#define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) |
|
|
|
|
|
|
|
// Texture abstraction |
|
|
|
|
|
|
|
#define TEXTURE2D(textureName) Texture2D textureName |
|
|
|
|
|
|
|
|
|
|
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) |
|
|
|
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) |
|
|
|
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) |
|
|
|
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) |
|
|
|
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) |
|
|
|
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) |
|
|
|