From 77e3c3bfb1f77ec04cd8e63a676bfa3e2ae2f998 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 17 Jul 2017 12:03:05 -0700 Subject: Map HLSL `SampleGrad` to GLSL `textureGrad[Offset]` - This was an easy case, as far as these things go. --- source/slang/slang-stdlib.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') 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, "; -- cgit v1.2.3