summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-07-03 09:38:23 -0700
committerGitHub <noreply@github.com>2025-07-03 16:38:23 +0000
commit20afbfea3134050fa93e48b5bb4edd59552384ec (patch)
treef4a1de961d5f6b76c4ca37e65e02bf2284b2a1cb /source
parent141eac9eb4400cf94c0a076f339e1d43ed652306 (diff)
Don't use access::sample for multisample texture in metal (#7601)
* don't use access::sample for multisample texture * Add test case * format code (#7603) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-metal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp
index a2e339942..9232fc95d 100644
--- a/source/slang/slang-emit-metal.cpp
+++ b/source/slang/slang-emit-metal.cpp
@@ -138,9 +138,9 @@ void MetalSourceEmitter::_emitHLSLTextureType(IRTextureTypeBase* texType)
{
case SLANG_RESOURCE_ACCESS_READ:
{
- // Metal does not support access::sample for texture buffers, so we need to emit
- // access::read instead.
- if (texType->GetBaseShape() == SLANG_TEXTURE_BUFFER)
+ // Metal does not support access::sample for texture buffers and multisampled textures,
+ // so we need to emit access::read instead.
+ if (texType->GetBaseShape() == SLANG_TEXTURE_BUFFER || texType->isMultisample())
m_writer->emit("access::read");
else
m_writer->emit("access::sample");