From 756fdb450739c9ac9aaf54a8d7a4def7408975ca Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 10 Aug 2023 14:59:05 -0700 Subject: Fix `Texture2D.Load()` with offset. (#3094) Co-authored-by: Yong He --- source/slang/core.meta.slang | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') 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) -- cgit v1.2.3