diff options
| author | Yong He <yonghe@outlook.com> | 2021-02-17 15:09:09 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-17 15:09:09 -0800 |
| commit | e59aee131b6d51236613bc374cfa2d5f3b54efe1 (patch) | |
| tree | 1225fb886e6b280ca50d737c1769bb8465480692 /source | |
| parent | 39975b207e5db7de8feaaebfda2ae122c1850b26 (diff) | |
Add `SampleGrad` overload for lod clamp. (#1711)
* Add `SampleGrad` overload for lod clamp.
* Fix gfx to run the test on vulkan.
* Whitespace change to trigger CI build
* remove presentFrame call in render-test
Co-authored-by: Yong He <yhe@nvidia.com>
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/core.meta.slang | 10 | ||||
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index 970ed1fa8..d63311985 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -1358,6 +1358,16 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt) sb << "float" << kBaseTextureTypes[tt].coordCount << " gradX, "; sb << "float" << kBaseTextureTypes[tt].coordCount << " gradY, "; sb << "constexpr int" << kBaseTextureTypes[tt].coordCount << " offset);\n"; + + sb << "__glsl_extension(GL_ARB_sparse_texture_clamp)"; + sb << "__target_intrinsic(glsl, \"$ctextureGradOffsetClampARB($p, $2, $3, $4, $5, $6)$z\")\n"; + sb << "T SampleGrad(SamplerState s, "; + sb << "float" << kBaseTextureTypes[tt].coordCount + isArray << " location, "; + sb << "float" << kBaseTextureTypes[tt].coordCount << " gradX, "; + sb << "float" << kBaseTextureTypes[tt].coordCount << " gradY, "; + sb << "constexpr int" << kBaseTextureTypes[tt].coordCount << " offset, "; + sb << "float lodClamp);\n"; + } // `SampleLevel` diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 1cfb8fecc..cd141a622 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -1148,6 +1148,10 @@ namespace Slang { return SLANG_BINDING_TYPE_CONSTANT_BUFFER; } + else if( as<SamplerStateType>(type) ) + { + return SLANG_BINDING_TYPE_SAMPLER; + } else { return SLANG_BINDING_TYPE_UNKNOWN; |
