diff --git a/tools/clang/lib/CodeGen/CGHLSLMS.cpp b/tools/clang/lib/CodeGen/CGHLSLMS.cpp index 72f5a791ab..02a8dc84ac 100644 --- a/tools/clang/lib/CodeGen/CGHLSLMS.cpp +++ b/tools/clang/lib/CodeGen/CGHLSLMS.cpp @@ -3991,6 +3991,8 @@ RValue CGMSHLSLRuntime::EmitHLSLBuiltinCallExpr(CodeGenFunction &CGF, // Not support half Eval yet. allOperandImm = false; break; + } else if (operand->getType()->isVectorTy()) { + allOperandImm = false; } } if (allOperandImm) { diff --git a/tools/clang/test/DXC/min16vector_constant_max.hlsl b/tools/clang/test/DXC/min16vector_constant_max.hlsl new file mode 100644 index 0000000000..d6ce71b885 --- /dev/null +++ b/tools/clang/test/DXC/min16vector_constant_max.hlsl @@ -0,0 +1,7 @@ +// Validate that the offsets for a min16float vector is correct if 16-bit types aren't enabled +// RUN: %dxc -T ps_6_0 -Od -Zi -Qembed_debug %s | FileCheck %s + +void main( out min16float4 outColor : SV_Target0) +{ + outColor = max( min16float4 (0,0,0,0), min16float4 (0,0,0,0)); +} \ No newline at end of file