diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-09-23 16:30:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-23 16:30:40 -0700 |
| commit | 6912c58538112e75f3c18c749ceabe8f316fcef8 (patch) | |
| tree | 1be575dfd8ee05dd5f80161e7096a609a20fc56c /source/slang/slang-stdlib-textures.cpp | |
| parent | 53684ed919ff2f5f3656aed2e95a111207452392 (diff) | |
Fix incorrect use of pointer in WGSL (#5144)
Closes #5143
Recently there was a commit that changed the behavior of the memory
pointer for WGSL.
This commit fixes some issues came up after the change.
Diffstat (limited to 'source/slang/slang-stdlib-textures.cpp')
| -rw-r--r-- | source/slang/slang-stdlib-textures.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/slang/slang-stdlib-textures.cpp b/source/slang/slang-stdlib-textures.cpp index a9f14522b..c9b7598c7 100644 --- a/source/slang/slang-stdlib-textures.cpp +++ b/source/slang/slang-stdlib-textures.cpp @@ -224,7 +224,7 @@ void TextureTypeInfo::writeGetDimensionFunctions() ++paramCount; params << t << "width"; metal << "(*($" << String(paramCount) << ") = $0.get_width(" << String(metalMipLevel) << ")),"; - wgsl << "*($" << String(paramCount) << ") = textureDimensions($0" << (includeMipInfo ? ", $1" : "") << ");"; + wgsl << "($" << String(paramCount) << ") = textureDimensions($0" << (includeMipInfo ? ", $1" : "") << ");"; sizeDimCount = 1; break; @@ -235,12 +235,12 @@ void TextureTypeInfo::writeGetDimensionFunctions() params << t << "width,"; metal << "(*($" << String(paramCount) << ") = $0.get_width(" << String(metalMipLevel) << ")),"; wgsl << "var dim = textureDimensions($0" << (includeMipInfo ? ", $1" : "") << ");"; - wgsl << "(*$" << String(paramCount) << ") = dim.x;"; + wgsl << "($" << String(paramCount) << ") = dim.x;"; ++paramCount; params << t << "height"; metal << "(*($" << String(paramCount) << ") = $0.get_height(" << String(metalMipLevel) << ")),"; - wgsl << "(*$" << String(paramCount) << ") = dim.y;"; + wgsl << "($" << String(paramCount) << ") = dim.y;"; sizeDimCount = 2; break; @@ -250,17 +250,17 @@ void TextureTypeInfo::writeGetDimensionFunctions() params << t << "width,"; metal << "(*($" << String(paramCount) << ") = $0.get_width(" << String(metalMipLevel) << ")),"; wgsl << "var dim = textureDimensions($0" << (includeMipInfo ? ", $1" : "") << ");"; - wgsl << "(*$" << String(paramCount) << ") = dim.x;"; + wgsl << "($" << String(paramCount) << ") = dim.x;"; ++paramCount; params << t << "height,"; metal << "(*($" << String(paramCount) << ") = $0.get_height(" << String(metalMipLevel) << ")),"; - wgsl << "(*$" << String(paramCount) << ") = dim.y;"; + wgsl << "($" << String(paramCount) << ") = dim.y;"; ++paramCount; params << t << "depth"; metal << "(*($" << String(paramCount) << ") = $0.get_depth(" << String(metalMipLevel) << ")),"; - wgsl << "(*$" << String(paramCount) << ") = dim.z;"; + wgsl << "($" << String(paramCount) << ") = dim.z;"; sizeDimCount = 3; break; @@ -276,7 +276,7 @@ void TextureTypeInfo::writeGetDimensionFunctions() ++paramCount; params << ", " << t << "elements"; metal << "(*($" << String(paramCount) << ") = $0.get_array_size()),"; - wgsl << "(*$" << String(paramCount) << ") = textureNumLayers($0);"; + wgsl << "($" << String(paramCount) << ") = textureNumLayers($0);"; } if (isMultisample) @@ -284,7 +284,7 @@ void TextureTypeInfo::writeGetDimensionFunctions() ++paramCount; params << ", " << t << "sampleCount"; metal << "(*($" << String(paramCount) << ") = $0.get_num_samples()),"; - wgsl << "(*$" << String(paramCount) << ") = textureNumSamples($0);"; + wgsl << "($" << String(paramCount) << ") = textureNumSamples($0);"; } if (includeMipInfo) @@ -292,7 +292,7 @@ void TextureTypeInfo::writeGetDimensionFunctions() ++paramCount; params << ", " << t << "numberOfLevels"; metal << "(*($" << String(paramCount) << ") = $0.get_num_mip_levels()),"; - wgsl << "(*$" << String(paramCount) << ") = textureNumLevels($0);"; + wgsl << "($" << String(paramCount) << ") = textureNumLevels($0);"; } metal.reduceLength(metal.getLength() - 1); // drop the last comma |
