[PATCH] D127802: [HLSL] Support HLSL vector initializers

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 06:53:46 PDT 2022


beanz added inline comments.


================
Comment at: clang/test/SemaHLSL/BuiltIns/vector-constructors-erros.hlsl:8
+void entry() {
+  float2 LilVec = float2(1.0, 2.0);
+  float2 BrokenVec = float2(1.0, 2.0, 3.0); // expected-error{{excess elements in vector initializer}}
----------------
python3kgae wrote:
> Could we have test case for array/struct when initialize vector?
> Like
> float a[2] = {1.2, 3.2};
> float4 arrayVec = float4(a, 1.0, 2.0);
This change does not support all of HLSL's odd initialization features. It only supports initializing vectors from scalars and vectors.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127802/new/

https://reviews.llvm.org/D127802



More information about the cfe-commits mailing list