From 3b4a50d74059a26af2ed8c37fb2042f33ba7cf2c Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 13 Apr 2023 10:34:08 -0700 Subject: Fix scalar swizzle write. (#2801) Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index e624ef1fd..92da981ad 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -4690,6 +4690,11 @@ namespace Slang { type = getVectorType(matrixType->getElementType(), matrixType->getColumnCount()); } + else if (auto basicType = as(basePtrType->getValueType())) + { + // HLSL support things like float.x, in which case we just return the base pointer. + return basePtr; + } SLANG_RELEASE_ASSERT(type); auto inst = createInst( this, -- cgit v1.2.3