From 4c78efd0c34442866f20e9d00bbb6908115c9a01 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Nov 2023 14:32:33 -0800 Subject: Unify stdlib `Texture` types into one generic type. (#3327) * Unify Texture types in stdlib into 1 generic type. * Fixes. * Fix. * Fixes. * Fix reflection. * Fix binding reflection. * Add gather intrinsics. * Fix gather intrinsics. * Fix texture type toText. * Fix intrinsic. * fix cuda intrinsic. * Fix project files. * cleanup. * Fix. * Fix. * Fix sampler feedback test. * Fix getDimension intrinsics. * Fix spirv sample image intrinsics. * Fix test. * Fix GLSL intrinsic. * Cleanup. --------- Co-authored-by: Yong He --- source/slang/slang-parser.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/slang/slang-parser.cpp') diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 0a2076fd0..52c91cfbe 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -6494,6 +6494,21 @@ namespace Slang parser->ReadMatchingToken(TokenType::RParent); return SPIRVAsmOperand{SPIRVAsmOperand::SampledType, Token{}, typeExpr}; } + // The __imageType function + if (AdvanceIf(parser, "__imageType")) + { + parser->ReadToken(TokenType::LParent); + const auto typeExpr = parser->ParseExpression(); + parser->ReadMatchingToken(TokenType::RParent); + return SPIRVAsmOperand{ SPIRVAsmOperand::ImageType, Token{}, typeExpr }; + } + if (AdvanceIf(parser, "__sampledImageType")) + { + parser->ReadToken(TokenType::LParent); + const auto typeExpr = parser->ParseExpression(); + parser->ReadMatchingToken(TokenType::RParent); + return SPIRVAsmOperand{ SPIRVAsmOperand::SampledImageType, Token{}, typeExpr }; + } // The pseudo-operand for component truncation else if(parser->LookAheadToken("__truncate")) { -- cgit v1.2.3