summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-04-13 10:34:08 -0700
committerGitHub <noreply@github.com>2023-04-13 10:34:08 -0700
commit3b4a50d74059a26af2ed8c37fb2042f33ba7cf2c (patch)
tree75a8337f5821ea30149df5292eb43a81c515498f /source
parent7f091478ec89550483b3cd30b4eb30ffa5e12a62 (diff)
Fix scalar swizzle write. (#2801)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir.cpp5
1 files changed, 5 insertions, 0 deletions
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<IRBasicType>(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<IRGetElementPtr>(
this,