D3D12.hlsl 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #define UNITY_UV_STARTS_AT_TOP 1
  2. #define UNITY_REVERSED_Z 1
  3. #define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
  4. #define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
  5. #define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
  6. #define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName
  7. #define TEXTURE2D(textureName) Texture2D textureName
  8. #define SAMPLER2D(samplerName) SamplerState samplerName
  9. #define TEXTURE3D(textureName) Texture3D textureName
  10. #define SAMPLER3D(samplerName) SamplerState samplerName
  11. #define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
  12. #define TEXTURE2D_PARAM(textureName, samplerName) textureName, samplerName
  13. #define TEXTURE3D_ARGS(textureName, samplerName) Texture3D textureName, SamplerState samplerName
  14. #define TEXTURE3D_PARAM(textureName, samplerName) textureName, samplerName
  15. #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
  16. #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
  17. #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
  18. #define LOAD_TEXTURE2D(textureName, texelSize, icoord2) textureName.Load(int3(icoord2, 0))
  19. #define LOAD_TEXTURE2D_LOD(textureName, texelSize, icoord2) textureName.Load(int3(icoord2, lod))
  20. #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2)
  21. #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2)
  22. #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2)
  23. #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2)
  24. #define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r
  25. #define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r
  26. #define UNITY_BRANCH [branch]
  27. #define UNITY_FLATTEN [flatten]
  28. #define UNITY_UNROLL [unroll]
  29. #define UNITY_LOOP [loop]
  30. #define UNITY_FASTOPT [fastopt]
  31. #define CBUFFER_START(name) cbuffer name {
  32. #define CBUFFER_END };
  33. #if UNITY_GATHER_SUPPORTED
  34. #define FXAA_HLSL_5 1
  35. #define SMAA_HLSL_4_1 1
  36. #else
  37. #define FXAA_HLSL_4 1
  38. #define SMAA_HLSL_4 1
  39. #endif