summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-stdlib.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-18 13:32:56 -0700
committerGitHub <noreply@github.com>2017-07-18 13:32:56 -0700
commit3d313d963f29f6ca6a8d12bd5c403a70c49aca2a (patch)
treed4a5f0cefd50c96aaf22921f9fef715b6359c0c5 /source/slang/slang-stdlib.cpp
parentac310e2d848f3174cfb88ca6166676afc2cbe3cd (diff)
parent1c022e2c3654de868c45658683f9e04cf4d68cc0 (diff)
Merge pull request #118 from tfoleyNV/falcor-shadow-fixes
Falcor shadow fixes
Diffstat (limited to 'source/slang/slang-stdlib.cpp')
-rw-r--r--source/slang/slang-stdlib.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index 5800a5deb..3062112c6 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -1808,13 +1808,19 @@ namespace Slang
for(auto kk : kGatherComponets)
{
+ auto componentIndex = kk.componentIndex;
auto componentName = kk.componentName;
EMIT_LINE_DIRECTIVE();
+
+ sb << "__intrinsic(glsl, \"textureGather($p, $1, " << componentIndex << ")\")\n";
+ sb << "__intrinsic\n";
sb << "vector<T, 4> Gather" << componentName << "(SamplerState s, ";
sb << "float" << kBaseTextureTypes[tt].coordCount << " location);\n";
EMIT_LINE_DIRECTIVE();
+ sb << "__intrinsic(glsl, \"textureGatherOffset($p, $1, $2, " << componentIndex << ")\")\n";
+ sb << "__intrinsic\n";
sb << "vector<T, 4> Gather" << componentName << "(SamplerState s, ";
sb << "float" << kBaseTextureTypes[tt].coordCount << " location, ";
sb << "int" << kBaseTextureTypes[tt].coordCount << " offset);\n";
@@ -1826,6 +1832,8 @@ namespace Slang
sb << "out uint status);\n";
EMIT_LINE_DIRECTIVE();
+ sb << "__intrinsic(glsl, \"textureGatherOffsets($p, $1, int" << kBaseTextureTypes[tt].coordCount << "[]($2, $3, $4, $5), " << componentIndex << ")\")\n";
+ sb << "__intrinsic\n";
sb << "vector<T, 4> Gather" << componentName << "(SamplerState s, ";
sb << "float" << kBaseTextureTypes[tt].coordCount << " location, ";
sb << "int" << kBaseTextureTypes[tt].coordCount << " offset1, ";