summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-10 14:59:05 -0700
committerGitHub <noreply@github.com>2023-08-10 14:59:05 -0700
commit756fdb450739c9ac9aaf54a8d7a4def7408975ca (patch)
treecb226dc510584e455430b6e8d2ab791a0e686c07 /source
parent38b0af3537f5d8412f0d69e39e38c5603ff62c15 (diff)
Fix `Texture2D.Load()` with offset. (#3094)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/core.meta.slang6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang
index efd0a743c..257d5930b 100644
--- a/source/slang/core.meta.slang
+++ b/source/slang/core.meta.slang
@@ -1641,7 +1641,9 @@ struct TextureTypeInfo
}
sb << ");\n";
+
// GLSL
+ glslFuncName = (access == SLANG_RESOURCE_ACCESS_READ) ? "texelFetchOffset" : "imageLoad";
if (isMultisample)
{
sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
@@ -1654,12 +1656,12 @@ struct TextureTypeInfo
if( needsMipLevel )
{
sb << "($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount];
+ sb << ", $2)$z\")\n";
}
else
{
- sb << "$1, 0";
+ sb << "$1, 0, $2)$z\")\n";
}
- sb << ", $2)$z\")\n";
}
if (isReadOnly)