diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-17 12:03:05 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-17 13:35:22 -0700 |
| commit | 77e3c3bfb1f77ec04cd8e63a676bfa3e2ae2f998 (patch) | |
| tree | 92cc58b873e7566110d4aa7f082a6a1c784b5820 /source/slang | |
| parent | fcf007268b077ee0d46553a62ae1b09528345be6 (diff) | |
Map HLSL `SampleGrad` to GLSL `textureGrad[Offset]`
- This was an easy case, as far as these things go.
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-stdlib.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp index 4fcef6639..3de33f554 100644 --- a/source/slang/slang-stdlib.cpp +++ b/source/slang/slang-stdlib.cpp @@ -1739,6 +1739,9 @@ namespace Slang sb << "int" << kBaseTextureTypes[tt].coordCount << " offset);\n"; } + + sb << "__intrinsic(glsl, \"textureGrad($p, $1, $2, $3)\")\n"; + sb << "__intrinsic\n"; sb << "T SampleGrad(SamplerState s, "; sb << "float" << kBaseTextureTypes[tt].coordCount + isArray << " location, "; sb << "float" << kBaseTextureTypes[tt].coordCount << " gradX, "; @@ -1747,6 +1750,8 @@ namespace Slang if( baseShape != TextureType::ShapeCube ) { + sb << "__intrinsic(glsl, \"textureGradOffset($p, $1, $2, $3, $4)\")\n"; + sb << "__intrinsic\n"; sb << "T SampleGrad(SamplerState s, "; sb << "float" << kBaseTextureTypes[tt].coordCount + isArray << " location, "; sb << "float" << kBaseTextureTypes[tt].coordCount << " gradX, "; |
