From 9fd3befa17c90cdad0e1fc4a8850ca540a74cbd5 Mon Sep 17 00:00:00 2001 From: James Price Date: Fri, 4 Jun 2021 17:31:48 +0000 Subject: [PATCH] tools: Return position from generated vertex shaders This is required to generate valid MSL code, and will soon be validated by Tint too. Change-Id: I4c5f5c4ecb1c91131c934de1132217d9f6be1f8e Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53420 Auto-Submit: James Price Kokoro: Kokoro Commit-Queue: Ben Clayton Reviewed-by: Ben Clayton --- test/intrinsics/gen/abs/002533.wgsl | 3 +- .../gen/abs/002533.wgsl.expected.hlsl | 9 ++- .../gen/abs/002533.wgsl.expected.msl | 9 ++- .../gen/abs/002533.wgsl.expected.spvasm | 56 +++++++++------ .../gen/abs/002533.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/005174.wgsl | 3 +- .../gen/abs/005174.wgsl.expected.hlsl | 9 ++- .../gen/abs/005174.wgsl.expected.msl | 9 ++- .../gen/abs/005174.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/005174.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/1ce782.wgsl | 3 +- .../gen/abs/1ce782.wgsl.expected.hlsl | 9 ++- .../gen/abs/1ce782.wgsl.expected.msl | 9 ++- .../gen/abs/1ce782.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/1ce782.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/1e9d53.wgsl | 3 +- .../gen/abs/1e9d53.wgsl.expected.hlsl | 9 ++- .../gen/abs/1e9d53.wgsl.expected.msl | 9 ++- .../gen/abs/1e9d53.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/1e9d53.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/467cd1.wgsl | 3 +- .../gen/abs/467cd1.wgsl.expected.hlsl | 9 ++- .../gen/abs/467cd1.wgsl.expected.msl | 9 ++- .../gen/abs/467cd1.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/467cd1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/4ad288.wgsl | 3 +- .../gen/abs/4ad288.wgsl.expected.hlsl | 9 ++- .../gen/abs/4ad288.wgsl.expected.msl | 9 ++- .../gen/abs/4ad288.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/4ad288.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/5ad50a.wgsl | 3 +- .../gen/abs/5ad50a.wgsl.expected.hlsl | 9 ++- .../gen/abs/5ad50a.wgsl.expected.msl | 9 ++- .../gen/abs/5ad50a.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/5ad50a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/7326de.wgsl | 3 +- .../gen/abs/7326de.wgsl.expected.hlsl | 9 ++- .../gen/abs/7326de.wgsl.expected.msl | 9 ++- .../gen/abs/7326de.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/7326de.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/7f28e6.wgsl | 3 +- .../gen/abs/7f28e6.wgsl.expected.hlsl | 9 ++- .../gen/abs/7f28e6.wgsl.expected.msl | 9 ++- .../gen/abs/7f28e6.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/7f28e6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/7faa9e.wgsl | 3 +- .../gen/abs/7faa9e.wgsl.expected.hlsl | 9 ++- .../gen/abs/7faa9e.wgsl.expected.msl | 9 ++- .../gen/abs/7faa9e.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/7faa9e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/9c80a6.wgsl | 3 +- .../gen/abs/9c80a6.wgsl.expected.hlsl | 9 ++- .../gen/abs/9c80a6.wgsl.expected.msl | 9 ++- .../gen/abs/9c80a6.wgsl.expected.spvasm | 54 +++++++++----- .../gen/abs/9c80a6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/abs/b96037.wgsl | 3 +- .../gen/abs/b96037.wgsl.expected.hlsl | 9 ++- .../gen/abs/b96037.wgsl.expected.msl | 9 ++- .../gen/abs/b96037.wgsl.expected.spvasm | 58 +++++++++------ .../gen/abs/b96037.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/acos/489247.wgsl | 3 +- .../gen/acos/489247.wgsl.expected.hlsl | 9 ++- .../gen/acos/489247.wgsl.expected.msl | 9 ++- .../gen/acos/489247.wgsl.expected.spvasm | 58 +++++++++------ .../gen/acos/489247.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/acos/8e2acf.wgsl | 3 +- .../gen/acos/8e2acf.wgsl.expected.hlsl | 9 ++- .../gen/acos/8e2acf.wgsl.expected.msl | 9 ++- .../gen/acos/8e2acf.wgsl.expected.spvasm | 56 +++++++++------ .../gen/acos/8e2acf.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/acos/a610c4.wgsl | 3 +- .../gen/acos/a610c4.wgsl.expected.hlsl | 9 ++- .../gen/acos/a610c4.wgsl.expected.msl | 9 ++- .../gen/acos/a610c4.wgsl.expected.spvasm | 54 +++++++++----- .../gen/acos/a610c4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/acos/dfc915.wgsl | 3 +- .../gen/acos/dfc915.wgsl.expected.hlsl | 9 ++- .../gen/acos/dfc915.wgsl.expected.msl | 9 ++- .../gen/acos/dfc915.wgsl.expected.spvasm | 54 +++++++++----- .../gen/acos/dfc915.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/all/986c7b.wgsl | 3 +- .../gen/all/986c7b.wgsl.expected.hlsl | 9 ++- .../gen/all/986c7b.wgsl.expected.msl | 9 ++- .../gen/all/986c7b.wgsl.expected.spvasm | 54 +++++++++----- .../gen/all/986c7b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/all/bd2dba.wgsl | 3 +- .../gen/all/bd2dba.wgsl.expected.hlsl | 9 ++- .../gen/all/bd2dba.wgsl.expected.msl | 9 ++- .../gen/all/bd2dba.wgsl.expected.spvasm | 54 +++++++++----- .../gen/all/bd2dba.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/all/f46790.wgsl | 3 +- .../gen/all/f46790.wgsl.expected.hlsl | 9 ++- .../gen/all/f46790.wgsl.expected.msl | 9 ++- .../gen/all/f46790.wgsl.expected.spvasm | 54 +++++++++----- .../gen/all/f46790.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/any/083428.wgsl | 3 +- .../gen/any/083428.wgsl.expected.hlsl | 9 ++- .../gen/any/083428.wgsl.expected.msl | 9 ++- .../gen/any/083428.wgsl.expected.spvasm | 54 +++++++++----- .../gen/any/083428.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/any/0e3e58.wgsl | 3 +- .../gen/any/0e3e58.wgsl.expected.hlsl | 9 ++- .../gen/any/0e3e58.wgsl.expected.msl | 9 ++- .../gen/any/0e3e58.wgsl.expected.spvasm | 54 +++++++++----- .../gen/any/0e3e58.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/any/e755c1.wgsl | 3 +- .../gen/any/e755c1.wgsl.expected.hlsl | 9 ++- .../gen/any/e755c1.wgsl.expected.msl | 9 ++- .../gen/any/e755c1.wgsl.expected.spvasm | 54 +++++++++----- .../gen/any/e755c1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/arrayLength/647a40.wgsl | 3 +- .../gen/arrayLength/647a40.wgsl.expected.hlsl | 16 +++-- .../arrayLength/647a40.wgsl.expected.spvasm | 52 +++++++++----- .../gen/arrayLength/647a40.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/arrayLength/721c9d.wgsl | 3 +- .../gen/arrayLength/721c9d.wgsl.expected.hlsl | 16 +++-- .../arrayLength/721c9d.wgsl.expected.spvasm | 52 +++++++++----- .../gen/arrayLength/721c9d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/arrayLength/b083be.wgsl | 3 +- .../gen/arrayLength/b083be.wgsl.expected.hlsl | 16 +++-- .../arrayLength/b083be.wgsl.expected.spvasm | 52 +++++++++----- .../gen/arrayLength/b083be.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/asin/064953.wgsl | 3 +- .../gen/asin/064953.wgsl.expected.hlsl | 9 ++- .../gen/asin/064953.wgsl.expected.msl | 9 ++- .../gen/asin/064953.wgsl.expected.spvasm | 56 +++++++++------ .../gen/asin/064953.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/asin/7b6a44.wgsl | 3 +- .../gen/asin/7b6a44.wgsl.expected.hlsl | 9 ++- .../gen/asin/7b6a44.wgsl.expected.msl | 9 ++- .../gen/asin/7b6a44.wgsl.expected.spvasm | 54 +++++++++----- .../gen/asin/7b6a44.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/asin/8cd9c9.wgsl | 3 +- .../gen/asin/8cd9c9.wgsl.expected.hlsl | 9 ++- .../gen/asin/8cd9c9.wgsl.expected.msl | 9 ++- .../gen/asin/8cd9c9.wgsl.expected.spvasm | 54 +++++++++----- .../gen/asin/8cd9c9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/asin/c0c272.wgsl | 3 +- .../gen/asin/c0c272.wgsl.expected.hlsl | 9 ++- .../gen/asin/c0c272.wgsl.expected.msl | 9 ++- .../gen/asin/c0c272.wgsl.expected.spvasm | 58 +++++++++------ .../gen/asin/c0c272.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan/02979a.wgsl | 3 +- .../gen/atan/02979a.wgsl.expected.hlsl | 9 ++- .../gen/atan/02979a.wgsl.expected.msl | 9 ++- .../gen/atan/02979a.wgsl.expected.spvasm | 58 +++++++++------ .../gen/atan/02979a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan/331e6d.wgsl | 3 +- .../gen/atan/331e6d.wgsl.expected.hlsl | 9 ++- .../gen/atan/331e6d.wgsl.expected.msl | 9 ++- .../gen/atan/331e6d.wgsl.expected.spvasm | 54 +++++++++----- .../gen/atan/331e6d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan/a8b696.wgsl | 3 +- .../gen/atan/a8b696.wgsl.expected.hlsl | 9 ++- .../gen/atan/a8b696.wgsl.expected.msl | 9 ++- .../gen/atan/a8b696.wgsl.expected.spvasm | 56 +++++++++------ .../gen/atan/a8b696.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan/ad96e4.wgsl | 3 +- .../gen/atan/ad96e4.wgsl.expected.hlsl | 9 ++- .../gen/atan/ad96e4.wgsl.expected.msl | 9 ++- .../gen/atan/ad96e4.wgsl.expected.spvasm | 54 +++++++++----- .../gen/atan/ad96e4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan2/57fb13.wgsl | 3 +- .../gen/atan2/57fb13.wgsl.expected.msl | 9 ++- .../gen/atan2/57fb13.wgsl.expected.spvasm | 54 +++++++++----- .../gen/atan2/57fb13.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan2/96057c.wgsl | 3 +- .../gen/atan2/96057c.wgsl.expected.hlsl | 9 ++- .../gen/atan2/96057c.wgsl.expected.msl | 9 ++- .../gen/atan2/96057c.wgsl.expected.spvasm | 58 +++++++++------ .../gen/atan2/96057c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan2/a70d0d.wgsl | 3 +- .../gen/atan2/a70d0d.wgsl.expected.msl | 9 ++- .../gen/atan2/a70d0d.wgsl.expected.spvasm | 54 +++++++++----- .../gen/atan2/a70d0d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/atan2/ae713e.wgsl | 3 +- .../gen/atan2/ae713e.wgsl.expected.msl | 9 ++- .../gen/atan2/ae713e.wgsl.expected.spvasm | 56 +++++++++------ .../gen/atan2/ae713e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ceil/34064b.wgsl | 3 +- .../gen/ceil/34064b.wgsl.expected.hlsl | 9 ++- .../gen/ceil/34064b.wgsl.expected.msl | 9 ++- .../gen/ceil/34064b.wgsl.expected.spvasm | 54 +++++++++----- .../gen/ceil/34064b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ceil/678655.wgsl | 3 +- .../gen/ceil/678655.wgsl.expected.hlsl | 9 ++- .../gen/ceil/678655.wgsl.expected.msl | 9 ++- .../gen/ceil/678655.wgsl.expected.spvasm | 58 +++++++++------ .../gen/ceil/678655.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ceil/96f597.wgsl | 3 +- .../gen/ceil/96f597.wgsl.expected.hlsl | 9 ++- .../gen/ceil/96f597.wgsl.expected.msl | 9 ++- .../gen/ceil/96f597.wgsl.expected.spvasm | 54 +++++++++----- .../gen/ceil/96f597.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ceil/b74c16.wgsl | 3 +- .../gen/ceil/b74c16.wgsl.expected.hlsl | 9 ++- .../gen/ceil/b74c16.wgsl.expected.msl | 9 ++- .../gen/ceil/b74c16.wgsl.expected.spvasm | 56 +++++++++------ .../gen/ceil/b74c16.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/0acf8f.wgsl | 3 +- .../gen/clamp/0acf8f.wgsl.expected.hlsl | 9 ++- .../gen/clamp/0acf8f.wgsl.expected.msl | 9 ++- .../gen/clamp/0acf8f.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/0acf8f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/1a32e3.wgsl | 3 +- .../gen/clamp/1a32e3.wgsl.expected.hlsl | 9 ++- .../gen/clamp/1a32e3.wgsl.expected.msl | 9 ++- .../gen/clamp/1a32e3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/1a32e3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/2bd567.wgsl | 3 +- .../gen/clamp/2bd567.wgsl.expected.hlsl | 9 ++- .../gen/clamp/2bd567.wgsl.expected.msl | 9 ++- .../gen/clamp/2bd567.wgsl.expected.spvasm | 58 +++++++++------ .../gen/clamp/2bd567.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/2bde41.wgsl | 3 +- .../gen/clamp/2bde41.wgsl.expected.hlsl | 9 ++- .../gen/clamp/2bde41.wgsl.expected.msl | 9 ++- .../gen/clamp/2bde41.wgsl.expected.spvasm | 56 +++++++++------ .../gen/clamp/2bde41.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/548fc7.wgsl | 3 +- .../gen/clamp/548fc7.wgsl.expected.hlsl | 9 ++- .../gen/clamp/548fc7.wgsl.expected.msl | 9 ++- .../gen/clamp/548fc7.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/548fc7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/5f0819.wgsl | 3 +- .../gen/clamp/5f0819.wgsl.expected.hlsl | 9 ++- .../gen/clamp/5f0819.wgsl.expected.msl | 9 ++- .../gen/clamp/5f0819.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/5f0819.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/6c1749.wgsl | 3 +- .../gen/clamp/6c1749.wgsl.expected.hlsl | 9 ++- .../gen/clamp/6c1749.wgsl.expected.msl | 9 ++- .../gen/clamp/6c1749.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/6c1749.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/7706d7.wgsl | 3 +- .../gen/clamp/7706d7.wgsl.expected.hlsl | 9 ++- .../gen/clamp/7706d7.wgsl.expected.msl | 9 ++- .../gen/clamp/7706d7.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/7706d7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/867397.wgsl | 3 +- .../gen/clamp/867397.wgsl.expected.hlsl | 9 ++- .../gen/clamp/867397.wgsl.expected.msl | 9 ++- .../gen/clamp/867397.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/867397.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/a2de25.wgsl | 3 +- .../gen/clamp/a2de25.wgsl.expected.hlsl | 9 ++- .../gen/clamp/a2de25.wgsl.expected.msl | 9 ++- .../gen/clamp/a2de25.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/a2de25.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/b07c65.wgsl | 3 +- .../gen/clamp/b07c65.wgsl.expected.hlsl | 9 ++- .../gen/clamp/b07c65.wgsl.expected.msl | 9 ++- .../gen/clamp/b07c65.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/b07c65.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/clamp/bd43ce.wgsl | 3 +- .../gen/clamp/bd43ce.wgsl.expected.hlsl | 9 ++- .../gen/clamp/bd43ce.wgsl.expected.msl | 9 ++- .../gen/clamp/bd43ce.wgsl.expected.spvasm | 54 +++++++++----- .../gen/clamp/bd43ce.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cos/16dc15.wgsl | 3 +- .../gen/cos/16dc15.wgsl.expected.hlsl | 9 ++- .../gen/cos/16dc15.wgsl.expected.msl | 9 ++- .../gen/cos/16dc15.wgsl.expected.spvasm | 54 +++++++++----- .../gen/cos/16dc15.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cos/29d66d.wgsl | 3 +- .../gen/cos/29d66d.wgsl.expected.hlsl | 9 ++- .../gen/cos/29d66d.wgsl.expected.msl | 9 ++- .../gen/cos/29d66d.wgsl.expected.spvasm | 56 +++++++++------ .../gen/cos/29d66d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cos/c3b486.wgsl | 3 +- .../gen/cos/c3b486.wgsl.expected.hlsl | 9 ++- .../gen/cos/c3b486.wgsl.expected.msl | 9 ++- .../gen/cos/c3b486.wgsl.expected.spvasm | 54 +++++++++----- .../gen/cos/c3b486.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cos/c5c28e.wgsl | 3 +- .../gen/cos/c5c28e.wgsl.expected.hlsl | 9 ++- .../gen/cos/c5c28e.wgsl.expected.msl | 9 ++- .../gen/cos/c5c28e.wgsl.expected.spvasm | 58 +++++++++------ .../gen/cos/c5c28e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cosh/377652.wgsl | 3 +- .../gen/cosh/377652.wgsl.expected.hlsl | 9 ++- .../gen/cosh/377652.wgsl.expected.msl | 9 ++- .../gen/cosh/377652.wgsl.expected.spvasm | 54 +++++++++----- .../gen/cosh/377652.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cosh/c13756.wgsl | 3 +- .../gen/cosh/c13756.wgsl.expected.hlsl | 9 ++- .../gen/cosh/c13756.wgsl.expected.msl | 9 ++- .../gen/cosh/c13756.wgsl.expected.spvasm | 54 +++++++++----- .../gen/cosh/c13756.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cosh/da92dd.wgsl | 3 +- .../gen/cosh/da92dd.wgsl.expected.hlsl | 9 ++- .../gen/cosh/da92dd.wgsl.expected.msl | 9 ++- .../gen/cosh/da92dd.wgsl.expected.spvasm | 58 +++++++++------ .../gen/cosh/da92dd.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cosh/e0c1de.wgsl | 3 +- .../gen/cosh/e0c1de.wgsl.expected.hlsl | 9 ++- .../gen/cosh/e0c1de.wgsl.expected.msl | 9 ++- .../gen/cosh/e0c1de.wgsl.expected.spvasm | 56 +++++++++------ .../gen/cosh/e0c1de.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/0d0e46.wgsl | 3 +- .../countOneBits/0d0e46.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/0d0e46.wgsl.expected.msl | 9 ++- .../countOneBits/0d0e46.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/0d0e46.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/0f7980.wgsl | 3 +- .../countOneBits/0f7980.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/0f7980.wgsl.expected.msl | 9 ++- .../countOneBits/0f7980.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/0f7980.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/65d2ae.wgsl | 3 +- .../countOneBits/65d2ae.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/65d2ae.wgsl.expected.msl | 9 ++- .../countOneBits/65d2ae.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/65d2ae.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/690cfc.wgsl | 3 +- .../countOneBits/690cfc.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/690cfc.wgsl.expected.msl | 9 ++- .../countOneBits/690cfc.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/690cfc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/94fd81.wgsl | 3 +- .../countOneBits/94fd81.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/94fd81.wgsl.expected.msl | 9 ++- .../countOneBits/94fd81.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/94fd81.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/ae44f9.wgsl | 3 +- .../countOneBits/ae44f9.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/ae44f9.wgsl.expected.msl | 9 ++- .../countOneBits/ae44f9.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/ae44f9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/af90e2.wgsl | 3 +- .../countOneBits/af90e2.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/af90e2.wgsl.expected.msl | 9 ++- .../countOneBits/af90e2.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/af90e2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/countOneBits/fd88b2.wgsl | 3 +- .../countOneBits/fd88b2.wgsl.expected.hlsl | 9 ++- .../gen/countOneBits/fd88b2.wgsl.expected.msl | 9 ++- .../countOneBits/fd88b2.wgsl.expected.spvasm | 52 +++++++++----- .../countOneBits/fd88b2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/cross/041cb0.wgsl | 3 +- .../gen/cross/041cb0.wgsl.expected.hlsl | 9 ++- .../gen/cross/041cb0.wgsl.expected.msl | 9 ++- .../gen/cross/041cb0.wgsl.expected.spvasm | 54 +++++++++----- .../gen/cross/041cb0.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/determinant/2b62ba.wgsl | 3 +- .../gen/determinant/2b62ba.wgsl.expected.hlsl | 9 ++- .../gen/determinant/2b62ba.wgsl.expected.msl | 9 ++- .../determinant/2b62ba.wgsl.expected.spvasm | 52 +++++++++----- .../gen/determinant/2b62ba.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/determinant/a0a87c.wgsl | 3 +- .../gen/determinant/a0a87c.wgsl.expected.hlsl | 9 ++- .../gen/determinant/a0a87c.wgsl.expected.msl | 9 ++- .../determinant/a0a87c.wgsl.expected.spvasm | 57 +++++++++------ .../gen/determinant/a0a87c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/determinant/e19305.wgsl | 3 +- .../gen/determinant/e19305.wgsl.expected.hlsl | 9 ++- .../gen/determinant/e19305.wgsl.expected.msl | 9 ++- .../determinant/e19305.wgsl.expected.spvasm | 52 +++++++++----- .../gen/determinant/e19305.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/distance/0657d4.wgsl | 3 +- .../gen/distance/0657d4.wgsl.expected.hlsl | 9 ++- .../gen/distance/0657d4.wgsl.expected.msl | 9 ++- .../gen/distance/0657d4.wgsl.expected.spvasm | 52 +++++++++----- .../gen/distance/0657d4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/distance/9646ea.wgsl | 3 +- .../gen/distance/9646ea.wgsl.expected.hlsl | 9 ++- .../gen/distance/9646ea.wgsl.expected.msl | 9 ++- .../gen/distance/9646ea.wgsl.expected.spvasm | 54 ++++++++------ .../gen/distance/9646ea.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/distance/aa4055.wgsl | 3 +- .../gen/distance/aa4055.wgsl.expected.hlsl | 9 ++- .../gen/distance/aa4055.wgsl.expected.msl | 9 ++- .../gen/distance/aa4055.wgsl.expected.spvasm | 52 +++++++++----- .../gen/distance/aa4055.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/distance/cfed73.wgsl | 3 +- .../gen/distance/cfed73.wgsl.expected.hlsl | 9 ++- .../gen/distance/cfed73.wgsl.expected.spvasm | 58 +++++++++------ .../gen/distance/cfed73.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/dot/0c577b.wgsl | 3 +- .../gen/dot/0c577b.wgsl.expected.hlsl | 9 ++- .../gen/dot/0c577b.wgsl.expected.msl | 9 ++- .../gen/dot/0c577b.wgsl.expected.spvasm | 52 +++++++++----- .../gen/dot/0c577b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/dot/883f0e.wgsl | 3 +- .../gen/dot/883f0e.wgsl.expected.hlsl | 9 ++- .../gen/dot/883f0e.wgsl.expected.msl | 9 ++- .../gen/dot/883f0e.wgsl.expected.spvasm | 50 ++++++++----- .../gen/dot/883f0e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/dot/ba4246.wgsl | 3 +- .../gen/dot/ba4246.wgsl.expected.hlsl | 9 ++- .../gen/dot/ba4246.wgsl.expected.msl | 9 ++- .../gen/dot/ba4246.wgsl.expected.spvasm | 50 ++++++++----- .../gen/dot/ba4246.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp/0f70eb.wgsl | 3 +- .../gen/exp/0f70eb.wgsl.expected.hlsl | 9 ++- .../gen/exp/0f70eb.wgsl.expected.msl | 9 ++- .../gen/exp/0f70eb.wgsl.expected.spvasm | 56 +++++++++------ .../gen/exp/0f70eb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp/1951e7.wgsl | 3 +- .../gen/exp/1951e7.wgsl.expected.hlsl | 9 ++- .../gen/exp/1951e7.wgsl.expected.msl | 9 ++- .../gen/exp/1951e7.wgsl.expected.spvasm | 54 +++++++++----- .../gen/exp/1951e7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp/771fd2.wgsl | 3 +- .../gen/exp/771fd2.wgsl.expected.hlsl | 9 ++- .../gen/exp/771fd2.wgsl.expected.msl | 9 ++- .../gen/exp/771fd2.wgsl.expected.spvasm | 58 +++++++++------ .../gen/exp/771fd2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp/d98450.wgsl | 3 +- .../gen/exp/d98450.wgsl.expected.hlsl | 9 ++- .../gen/exp/d98450.wgsl.expected.msl | 9 ++- .../gen/exp/d98450.wgsl.expected.spvasm | 54 +++++++++----- .../gen/exp/d98450.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp2/1f8680.wgsl | 3 +- .../gen/exp2/1f8680.wgsl.expected.hlsl | 9 ++- .../gen/exp2/1f8680.wgsl.expected.msl | 9 ++- .../gen/exp2/1f8680.wgsl.expected.spvasm | 54 +++++++++----- .../gen/exp2/1f8680.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp2/a9d0a7.wgsl | 3 +- .../gen/exp2/a9d0a7.wgsl.expected.hlsl | 9 ++- .../gen/exp2/a9d0a7.wgsl.expected.msl | 9 ++- .../gen/exp2/a9d0a7.wgsl.expected.spvasm | 56 +++++++++------ .../gen/exp2/a9d0a7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp2/d6777c.wgsl | 3 +- .../gen/exp2/d6777c.wgsl.expected.hlsl | 9 ++- .../gen/exp2/d6777c.wgsl.expected.msl | 9 ++- .../gen/exp2/d6777c.wgsl.expected.spvasm | 54 +++++++++----- .../gen/exp2/d6777c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/exp2/dea523.wgsl | 3 +- .../gen/exp2/dea523.wgsl.expected.hlsl | 9 ++- .../gen/exp2/dea523.wgsl.expected.msl | 9 ++- .../gen/exp2/dea523.wgsl.expected.spvasm | 58 +++++++++------ .../gen/exp2/dea523.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/faceForward/5afbd5.wgsl | 3 +- .../gen/faceForward/5afbd5.wgsl.expected.hlsl | 9 ++- .../gen/faceForward/5afbd5.wgsl.expected.msl | 9 ++- .../faceForward/5afbd5.wgsl.expected.spvasm | 54 +++++++++----- .../gen/faceForward/5afbd5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/faceForward/b316e5.wgsl | 3 +- .../gen/faceForward/b316e5.wgsl.expected.hlsl | 9 ++- .../gen/faceForward/b316e5.wgsl.expected.msl | 9 ++- .../faceForward/b316e5.wgsl.expected.spvasm | 56 +++++++++------ .../gen/faceForward/b316e5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/faceForward/e6908b.wgsl | 3 +- .../gen/faceForward/e6908b.wgsl.expected.hlsl | 9 ++- .../gen/faceForward/e6908b.wgsl.expected.msl | 9 ++- .../faceForward/e6908b.wgsl.expected.spvasm | 54 +++++++++----- .../gen/faceForward/e6908b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/faceForward/fc994b.wgsl | 3 +- .../gen/faceForward/fc994b.wgsl.expected.hlsl | 9 ++- .../faceForward/fc994b.wgsl.expected.spvasm | 58 +++++++++------ .../gen/faceForward/fc994b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/floor/3bccc4.wgsl | 3 +- .../gen/floor/3bccc4.wgsl.expected.hlsl | 9 ++- .../gen/floor/3bccc4.wgsl.expected.msl | 9 ++- .../gen/floor/3bccc4.wgsl.expected.spvasm | 56 +++++++++------ .../gen/floor/3bccc4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/floor/5fc9ac.wgsl | 3 +- .../gen/floor/5fc9ac.wgsl.expected.hlsl | 9 ++- .../gen/floor/5fc9ac.wgsl.expected.msl | 9 ++- .../gen/floor/5fc9ac.wgsl.expected.spvasm | 54 +++++++++----- .../gen/floor/5fc9ac.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/floor/60d7ea.wgsl | 3 +- .../gen/floor/60d7ea.wgsl.expected.hlsl | 9 ++- .../gen/floor/60d7ea.wgsl.expected.msl | 9 ++- .../gen/floor/60d7ea.wgsl.expected.spvasm | 54 +++++++++----- .../gen/floor/60d7ea.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/floor/66f154.wgsl | 3 +- .../gen/floor/66f154.wgsl.expected.hlsl | 9 ++- .../gen/floor/66f154.wgsl.expected.msl | 9 ++- .../gen/floor/66f154.wgsl.expected.spvasm | 58 +++++++++------ .../gen/floor/66f154.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fma/26a7a9.wgsl | 3 +- .../gen/fma/26a7a9.wgsl.expected.msl | 9 ++- .../gen/fma/26a7a9.wgsl.expected.spvasm | 54 +++++++++----- .../gen/fma/26a7a9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fma/6a3283.wgsl | 3 +- .../gen/fma/6a3283.wgsl.expected.msl | 9 ++- .../gen/fma/6a3283.wgsl.expected.spvasm | 56 +++++++++------ .../gen/fma/6a3283.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fma/c10ba3.wgsl | 3 +- .../gen/fma/c10ba3.wgsl.expected.msl | 9 ++- .../gen/fma/c10ba3.wgsl.expected.spvasm | 58 +++++++++------ .../gen/fma/c10ba3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fma/e17c5c.wgsl | 3 +- .../gen/fma/e17c5c.wgsl.expected.msl | 9 ++- .../gen/fma/e17c5c.wgsl.expected.spvasm | 54 +++++++++----- .../gen/fma/e17c5c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fract/8bc1e9.wgsl | 3 +- .../gen/fract/8bc1e9.wgsl.expected.hlsl | 9 ++- .../gen/fract/8bc1e9.wgsl.expected.msl | 9 ++- .../gen/fract/8bc1e9.wgsl.expected.spvasm | 56 +++++++++------ .../gen/fract/8bc1e9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fract/943cb1.wgsl | 3 +- .../gen/fract/943cb1.wgsl.expected.hlsl | 9 ++- .../gen/fract/943cb1.wgsl.expected.msl | 9 ++- .../gen/fract/943cb1.wgsl.expected.spvasm | 54 +++++++++----- .../gen/fract/943cb1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fract/a49758.wgsl | 3 +- .../gen/fract/a49758.wgsl.expected.hlsl | 9 ++- .../gen/fract/a49758.wgsl.expected.msl | 9 ++- .../gen/fract/a49758.wgsl.expected.spvasm | 54 +++++++++----- .../gen/fract/a49758.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fract/fa5c71.wgsl | 3 +- .../gen/fract/fa5c71.wgsl.expected.hlsl | 9 ++- .../gen/fract/fa5c71.wgsl.expected.msl | 9 ++- .../gen/fract/fa5c71.wgsl.expected.spvasm | 58 +++++++++------ .../gen/fract/fa5c71.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/1d6b62.wgsl | 3 +- .../gen/frexp/1d6b62.wgsl.expected.spvasm | 58 +++++++++------ .../gen/frexp/1d6b62.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/2507b2.wgsl | 3 +- .../gen/frexp/2507b2.wgsl.expected.spvasm | 60 ++++++++++------ .../gen/frexp/2507b2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/2a171c.wgsl | 3 +- .../gen/frexp/2a171c.wgsl.expected.spvasm | 58 +++++++++------ .../gen/frexp/2a171c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/34dd30.wgsl | 3 +- .../gen/frexp/34dd30.wgsl.expected.spvasm | 62 ++++++++++------ .../gen/frexp/34dd30.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/4b73e3.wgsl | 3 +- .../gen/frexp/4b73e3.wgsl.expected.spvasm | 60 ++++++++++------ .../gen/frexp/4b73e3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/79ed81.wgsl | 3 +- .../gen/frexp/79ed81.wgsl.expected.spvasm | 58 +++++++++------ .../gen/frexp/79ed81.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/99b922.wgsl | 3 +- .../gen/frexp/99b922.wgsl.expected.spvasm | 62 ++++++++++------ .../gen/frexp/99b922.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/frexp/cb41c5.wgsl | 3 +- .../gen/frexp/cb41c5.wgsl.expected.spvasm | 58 +++++++++------ .../gen/frexp/cb41c5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidth/5d1b39.wgsl | 3 +- .../gen/fwidth/5d1b39.wgsl.expected.hlsl | 9 ++- .../gen/fwidth/5d1b39.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidth/b83ebb.wgsl | 3 +- .../gen/fwidth/b83ebb.wgsl.expected.hlsl | 9 ++- .../gen/fwidth/b83ebb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidth/d2ab9a.wgsl | 3 +- .../gen/fwidth/d2ab9a.wgsl.expected.hlsl | 9 ++- .../gen/fwidth/d2ab9a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidth/df38ef.wgsl | 3 +- .../gen/fwidth/df38ef.wgsl.expected.hlsl | 9 ++- .../gen/fwidth/df38ef.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthCoarse/159c8a.wgsl | 3 +- .../fwidthCoarse/159c8a.wgsl.expected.hlsl | 9 ++- .../fwidthCoarse/159c8a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl | 3 +- .../fwidthCoarse/1e59d9.wgsl.expected.hlsl | 9 ++- .../fwidthCoarse/1e59d9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl | 3 +- .../fwidthCoarse/4e4fc4.wgsl.expected.hlsl | 9 ++- .../fwidthCoarse/4e4fc4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthCoarse/e653f7.wgsl | 3 +- .../fwidthCoarse/e653f7.wgsl.expected.hlsl | 9 ++- .../fwidthCoarse/e653f7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthFine/523fdc.wgsl | 3 +- .../gen/fwidthFine/523fdc.wgsl.expected.hlsl | 9 ++- .../gen/fwidthFine/523fdc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthFine/68f4ef.wgsl | 3 +- .../gen/fwidthFine/68f4ef.wgsl.expected.hlsl | 9 ++- .../gen/fwidthFine/68f4ef.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthFine/f1742d.wgsl | 3 +- .../gen/fwidthFine/f1742d.wgsl.expected.hlsl | 9 ++- .../gen/fwidthFine/f1742d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/fwidthFine/ff6aa0.wgsl | 3 +- .../gen/fwidthFine/ff6aa0.wgsl.expected.hlsl | 9 ++- .../gen/fwidthFine/ff6aa0.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/inverseSqrt/84407e.wgsl | 3 +- .../gen/inverseSqrt/84407e.wgsl.expected.hlsl | 9 ++- .../gen/inverseSqrt/84407e.wgsl.expected.msl | 9 ++- .../inverseSqrt/84407e.wgsl.expected.spvasm | 58 +++++++++------ .../gen/inverseSqrt/84407e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl | 3 +- .../gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl | 9 ++- .../gen/inverseSqrt/8f2bd2.wgsl.expected.msl | 9 ++- .../inverseSqrt/8f2bd2.wgsl.expected.spvasm | 54 +++++++++----- .../gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/inverseSqrt/b197b1.wgsl | 3 +- .../gen/inverseSqrt/b197b1.wgsl.expected.hlsl | 9 ++- .../gen/inverseSqrt/b197b1.wgsl.expected.msl | 9 ++- .../inverseSqrt/b197b1.wgsl.expected.spvasm | 54 +++++++++----- .../gen/inverseSqrt/b197b1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/inverseSqrt/c22347.wgsl | 3 +- .../gen/inverseSqrt/c22347.wgsl.expected.hlsl | 9 ++- .../gen/inverseSqrt/c22347.wgsl.expected.msl | 9 ++- .../inverseSqrt/c22347.wgsl.expected.spvasm | 56 +++++++++------ .../gen/inverseSqrt/c22347.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isFinite/34d32b.wgsl | 3 +- .../gen/isFinite/34d32b.wgsl.expected.hlsl | 9 ++- .../gen/isFinite/34d32b.wgsl.expected.msl | 9 ++- .../gen/isFinite/34d32b.wgsl.expected.spvasm | 60 ++++++++++------ .../gen/isFinite/34d32b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isFinite/426f9f.wgsl | 3 +- .../gen/isFinite/426f9f.wgsl.expected.hlsl | 9 ++- .../gen/isFinite/426f9f.wgsl.expected.msl | 9 ++- .../gen/isFinite/426f9f.wgsl.expected.spvasm | 66 ++++++++++------- .../gen/isFinite/426f9f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isFinite/8a23ad.wgsl | 3 +- .../gen/isFinite/8a23ad.wgsl.expected.hlsl | 9 ++- .../gen/isFinite/8a23ad.wgsl.expected.msl | 9 ++- .../gen/isFinite/8a23ad.wgsl.expected.spvasm | 60 ++++++++++------ .../gen/isFinite/8a23ad.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isFinite/f31987.wgsl | 3 +- .../gen/isFinite/f31987.wgsl.expected.hlsl | 9 ++- .../gen/isFinite/f31987.wgsl.expected.msl | 9 ++- .../gen/isFinite/f31987.wgsl.expected.spvasm | 62 +++++++++------- .../gen/isFinite/f31987.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isInf/666f2a.wgsl | 3 +- .../gen/isInf/666f2a.wgsl.expected.hlsl | 9 ++- .../gen/isInf/666f2a.wgsl.expected.msl | 9 ++- .../gen/isInf/666f2a.wgsl.expected.spvasm | 54 +++++++++----- .../gen/isInf/666f2a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isInf/7bd98f.wgsl | 3 +- .../gen/isInf/7bd98f.wgsl.expected.hlsl | 9 ++- .../gen/isInf/7bd98f.wgsl.expected.msl | 9 ++- .../gen/isInf/7bd98f.wgsl.expected.spvasm | 60 ++++++++++------ .../gen/isInf/7bd98f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isInf/7e81b5.wgsl | 3 +- .../gen/isInf/7e81b5.wgsl.expected.hlsl | 9 ++- .../gen/isInf/7e81b5.wgsl.expected.msl | 9 ++- .../gen/isInf/7e81b5.wgsl.expected.spvasm | 56 +++++++++------ .../gen/isInf/7e81b5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isInf/a46d6f.wgsl | 3 +- .../gen/isInf/a46d6f.wgsl.expected.hlsl | 9 ++- .../gen/isInf/a46d6f.wgsl.expected.msl | 9 ++- .../gen/isInf/a46d6f.wgsl.expected.spvasm | 54 +++++++++----- .../gen/isInf/a46d6f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNan/1280ab.wgsl | 3 +- .../gen/isNan/1280ab.wgsl.expected.msl | 9 ++- .../gen/isNan/1280ab.wgsl.expected.spvasm | 54 +++++++++----- .../gen/isNan/1280ab.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNan/4d280d.wgsl | 3 +- .../gen/isNan/4d280d.wgsl.expected.msl | 9 ++- .../gen/isNan/4d280d.wgsl.expected.spvasm | 56 +++++++++------ .../gen/isNan/4d280d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNan/67ecd3.wgsl | 3 +- .../gen/isNan/67ecd3.wgsl.expected.msl | 9 ++- .../gen/isNan/67ecd3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/isNan/67ecd3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNan/e4978e.wgsl | 3 +- .../gen/isNan/e4978e.wgsl.expected.hlsl | 9 ++- .../gen/isNan/e4978e.wgsl.expected.msl | 9 ++- .../gen/isNan/e4978e.wgsl.expected.spvasm | 60 ++++++++++------ .../gen/isNan/e4978e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNormal/863dcd.wgsl | 3 +- .../gen/isNormal/863dcd.wgsl.expected.msl | 9 ++- .../gen/isNormal/863dcd.wgsl.expected.spvasm | 70 ++++++++++-------- .../gen/isNormal/863dcd.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNormal/b00ab1.wgsl | 3 +- .../gen/isNormal/b00ab1.wgsl.expected.msl | 9 ++- .../gen/isNormal/b00ab1.wgsl.expected.spvasm | 68 +++++++++++------- .../gen/isNormal/b00ab1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNormal/c286b7.wgsl | 3 +- .../gen/isNormal/c286b7.wgsl.expected.msl | 9 ++- .../gen/isNormal/c286b7.wgsl.expected.spvasm | 68 +++++++++++------- .../gen/isNormal/c286b7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/isNormal/c6e880.wgsl | 3 +- .../gen/isNormal/c6e880.wgsl.expected.msl | 9 ++- .../gen/isNormal/c6e880.wgsl.expected.spvasm | 68 +++++++++++------- .../gen/isNormal/c6e880.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/2cb32a.wgsl | 3 +- .../gen/ldexp/2cb32a.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/2cb32a.wgsl.expected.spvasm | 56 +++++++++------ .../gen/ldexp/2cb32a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/4d6f6d.wgsl | 3 +- .../gen/ldexp/4d6f6d.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/4d6f6d.wgsl.expected.spvasm | 58 +++++++++------ .../gen/ldexp/4d6f6d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/7bc2fd.wgsl | 3 +- .../gen/ldexp/7bc2fd.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/7bc2fd.wgsl.expected.spvasm | 56 +++++++++------ .../gen/ldexp/7bc2fd.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/a31cdc.wgsl | 3 +- .../gen/ldexp/a31cdc.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/a31cdc.wgsl.expected.msl | 9 ++- .../gen/ldexp/a31cdc.wgsl.expected.spvasm | 56 +++++++++------ .../gen/ldexp/a31cdc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/abd718.wgsl | 3 +- .../gen/ldexp/abd718.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/abd718.wgsl.expected.msl | 9 ++- .../gen/ldexp/abd718.wgsl.expected.spvasm | 56 +++++++++------ .../gen/ldexp/abd718.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/cc9cde.wgsl | 3 +- .../gen/ldexp/cc9cde.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/cc9cde.wgsl.expected.msl | 9 ++- .../gen/ldexp/cc9cde.wgsl.expected.spvasm | 58 +++++++++------ .../gen/ldexp/cc9cde.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/db8b49.wgsl | 3 +- .../gen/ldexp/db8b49.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/db8b49.wgsl.expected.msl | 9 ++- .../gen/ldexp/db8b49.wgsl.expected.spvasm | 58 +++++++++------ .../gen/ldexp/db8b49.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/ldexp/f54ff2.wgsl | 3 +- .../gen/ldexp/f54ff2.wgsl.expected.hlsl | 9 ++- .../gen/ldexp/f54ff2.wgsl.expected.msl | 9 ++- .../gen/ldexp/f54ff2.wgsl.expected.spvasm | 58 +++++++++------ .../gen/ldexp/f54ff2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/length/056071.wgsl | 3 +- .../gen/length/056071.wgsl.expected.hlsl | 9 ++- .../gen/length/056071.wgsl.expected.msl | 9 ++- .../gen/length/056071.wgsl.expected.spvasm | 52 +++++++++----- .../gen/length/056071.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/length/602a17.wgsl | 3 +- .../gen/length/602a17.wgsl.expected.hlsl | 9 ++- .../gen/length/602a17.wgsl.expected.spvasm | 58 +++++++++------ .../gen/length/602a17.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/length/afde8b.wgsl | 3 +- .../gen/length/afde8b.wgsl.expected.hlsl | 9 ++- .../gen/length/afde8b.wgsl.expected.msl | 9 ++- .../gen/length/afde8b.wgsl.expected.spvasm | 52 +++++++++----- .../gen/length/afde8b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/length/becebf.wgsl | 3 +- .../gen/length/becebf.wgsl.expected.hlsl | 9 ++- .../gen/length/becebf.wgsl.expected.msl | 9 ++- .../gen/length/becebf.wgsl.expected.spvasm | 54 ++++++++------ .../gen/length/becebf.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log/3da25a.wgsl | 3 +- .../gen/log/3da25a.wgsl.expected.hlsl | 9 ++- .../gen/log/3da25a.wgsl.expected.msl | 9 ++- .../gen/log/3da25a.wgsl.expected.spvasm | 56 +++++++++------ .../gen/log/3da25a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log/7114a6.wgsl | 3 +- .../gen/log/7114a6.wgsl.expected.hlsl | 9 ++- .../gen/log/7114a6.wgsl.expected.msl | 9 ++- .../gen/log/7114a6.wgsl.expected.spvasm | 58 +++++++++------ .../gen/log/7114a6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log/b2ce28.wgsl | 3 +- .../gen/log/b2ce28.wgsl.expected.hlsl | 9 ++- .../gen/log/b2ce28.wgsl.expected.msl | 9 ++- .../gen/log/b2ce28.wgsl.expected.spvasm | 54 +++++++++----- .../gen/log/b2ce28.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log/f4c570.wgsl | 3 +- .../gen/log/f4c570.wgsl.expected.hlsl | 9 ++- .../gen/log/f4c570.wgsl.expected.msl | 9 ++- .../gen/log/f4c570.wgsl.expected.spvasm | 54 +++++++++----- .../gen/log/f4c570.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log2/4036ed.wgsl | 3 +- .../gen/log2/4036ed.wgsl.expected.hlsl | 9 ++- .../gen/log2/4036ed.wgsl.expected.msl | 9 ++- .../gen/log2/4036ed.wgsl.expected.spvasm | 58 +++++++++------ .../gen/log2/4036ed.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log2/902988.wgsl | 3 +- .../gen/log2/902988.wgsl.expected.hlsl | 9 ++- .../gen/log2/902988.wgsl.expected.msl | 9 ++- .../gen/log2/902988.wgsl.expected.spvasm | 56 +++++++++------ .../gen/log2/902988.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log2/adb233.wgsl | 3 +- .../gen/log2/adb233.wgsl.expected.hlsl | 9 ++- .../gen/log2/adb233.wgsl.expected.msl | 9 ++- .../gen/log2/adb233.wgsl.expected.spvasm | 54 +++++++++----- .../gen/log2/adb233.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/log2/aea659.wgsl | 3 +- .../gen/log2/aea659.wgsl.expected.hlsl | 9 ++- .../gen/log2/aea659.wgsl.expected.msl | 9 ++- .../gen/log2/aea659.wgsl.expected.spvasm | 54 +++++++++----- .../gen/log2/aea659.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/0c0aae.wgsl | 3 +- .../gen/max/0c0aae.wgsl.expected.hlsl | 9 ++- .../gen/max/0c0aae.wgsl.expected.msl | 9 ++- .../gen/max/0c0aae.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/0c0aae.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/25eafe.wgsl | 3 +- .../gen/max/25eafe.wgsl.expected.hlsl | 9 ++- .../gen/max/25eafe.wgsl.expected.msl | 9 ++- .../gen/max/25eafe.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/25eafe.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/320815.wgsl | 3 +- .../gen/max/320815.wgsl.expected.hlsl | 9 ++- .../gen/max/320815.wgsl.expected.msl | 9 ++- .../gen/max/320815.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/320815.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/44a39d.wgsl | 3 +- .../gen/max/44a39d.wgsl.expected.hlsl | 9 ++- .../gen/max/44a39d.wgsl.expected.msl | 9 ++- .../gen/max/44a39d.wgsl.expected.spvasm | 58 +++++++++------ .../gen/max/44a39d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/453e04.wgsl | 3 +- .../gen/max/453e04.wgsl.expected.hlsl | 9 ++- .../gen/max/453e04.wgsl.expected.msl | 9 ++- .../gen/max/453e04.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/453e04.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/462050.wgsl | 3 +- .../gen/max/462050.wgsl.expected.hlsl | 9 ++- .../gen/max/462050.wgsl.expected.msl | 9 ++- .../gen/max/462050.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/462050.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/4883ac.wgsl | 3 +- .../gen/max/4883ac.wgsl.expected.hlsl | 9 ++- .../gen/max/4883ac.wgsl.expected.msl | 9 ++- .../gen/max/4883ac.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/4883ac.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/85e6bc.wgsl | 3 +- .../gen/max/85e6bc.wgsl.expected.hlsl | 9 ++- .../gen/max/85e6bc.wgsl.expected.msl | 9 ++- .../gen/max/85e6bc.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/85e6bc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/a93419.wgsl | 3 +- .../gen/max/a93419.wgsl.expected.hlsl | 9 ++- .../gen/max/a93419.wgsl.expected.msl | 9 ++- .../gen/max/a93419.wgsl.expected.spvasm | 56 +++++++++------ .../gen/max/a93419.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/b1b73a.wgsl | 3 +- .../gen/max/b1b73a.wgsl.expected.hlsl | 9 ++- .../gen/max/b1b73a.wgsl.expected.msl | 9 ++- .../gen/max/b1b73a.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/b1b73a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/ce7c30.wgsl | 3 +- .../gen/max/ce7c30.wgsl.expected.hlsl | 9 ++- .../gen/max/ce7c30.wgsl.expected.msl | 9 ++- .../gen/max/ce7c30.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/ce7c30.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/max/e8192f.wgsl | 3 +- .../gen/max/e8192f.wgsl.expected.hlsl | 9 ++- .../gen/max/e8192f.wgsl.expected.msl | 9 ++- .../gen/max/e8192f.wgsl.expected.spvasm | 54 +++++++++----- .../gen/max/e8192f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/03c7e3.wgsl | 3 +- .../gen/min/03c7e3.wgsl.expected.hlsl | 9 ++- .../gen/min/03c7e3.wgsl.expected.msl | 9 ++- .../gen/min/03c7e3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/03c7e3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/0dc614.wgsl | 3 +- .../gen/min/0dc614.wgsl.expected.hlsl | 9 ++- .../gen/min/0dc614.wgsl.expected.msl | 9 ++- .../gen/min/0dc614.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/0dc614.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/3941e1.wgsl | 3 +- .../gen/min/3941e1.wgsl.expected.hlsl | 9 ++- .../gen/min/3941e1.wgsl.expected.msl | 9 ++- .../gen/min/3941e1.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/3941e1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/46c5d3.wgsl | 3 +- .../gen/min/46c5d3.wgsl.expected.hlsl | 9 ++- .../gen/min/46c5d3.wgsl.expected.msl | 9 ++- .../gen/min/46c5d3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/46c5d3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/82b28f.wgsl | 3 +- .../gen/min/82b28f.wgsl.expected.hlsl | 9 ++- .../gen/min/82b28f.wgsl.expected.msl | 9 ++- .../gen/min/82b28f.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/82b28f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/93cfc4.wgsl | 3 +- .../gen/min/93cfc4.wgsl.expected.hlsl | 9 ++- .../gen/min/93cfc4.wgsl.expected.msl | 9 ++- .../gen/min/93cfc4.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/93cfc4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/a45171.wgsl | 3 +- .../gen/min/a45171.wgsl.expected.hlsl | 9 ++- .../gen/min/a45171.wgsl.expected.msl | 9 ++- .../gen/min/a45171.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/a45171.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/aa28ad.wgsl | 3 +- .../gen/min/aa28ad.wgsl.expected.hlsl | 9 ++- .../gen/min/aa28ad.wgsl.expected.msl | 9 ++- .../gen/min/aa28ad.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/aa28ad.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/af326d.wgsl | 3 +- .../gen/min/af326d.wgsl.expected.hlsl | 9 ++- .../gen/min/af326d.wgsl.expected.msl | 9 ++- .../gen/min/af326d.wgsl.expected.spvasm | 58 +++++++++------ .../gen/min/af326d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/c70bb7.wgsl | 3 +- .../gen/min/c70bb7.wgsl.expected.hlsl | 9 ++- .../gen/min/c70bb7.wgsl.expected.msl | 9 ++- .../gen/min/c70bb7.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/c70bb7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/c73147.wgsl | 3 +- .../gen/min/c73147.wgsl.expected.hlsl | 9 ++- .../gen/min/c73147.wgsl.expected.msl | 9 ++- .../gen/min/c73147.wgsl.expected.spvasm | 54 +++++++++----- .../gen/min/c73147.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/min/c76fa6.wgsl | 3 +- .../gen/min/c76fa6.wgsl.expected.hlsl | 9 ++- .../gen/min/c76fa6.wgsl.expected.msl | 9 ++- .../gen/min/c76fa6.wgsl.expected.spvasm | 56 +++++++++------ .../gen/min/c76fa6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/mix/0c8c33.wgsl | 3 +- .../gen/mix/0c8c33.wgsl.expected.hlsl | 9 ++- .../gen/mix/0c8c33.wgsl.expected.msl | 9 ++- .../gen/mix/0c8c33.wgsl.expected.spvasm | 54 +++++++++----- .../gen/mix/0c8c33.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/mix/4f0b5e.wgsl | 3 +- .../gen/mix/4f0b5e.wgsl.expected.hlsl | 9 ++- .../gen/mix/4f0b5e.wgsl.expected.msl | 9 ++- .../gen/mix/4f0b5e.wgsl.expected.spvasm | 58 +++++++++------ .../gen/mix/4f0b5e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/mix/6f8adc.wgsl | 3 +- .../gen/mix/6f8adc.wgsl.expected.hlsl | 9 ++- .../gen/mix/6f8adc.wgsl.expected.msl | 9 ++- .../gen/mix/6f8adc.wgsl.expected.spvasm | 54 +++++++++----- .../gen/mix/6f8adc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/mix/c37ede.wgsl | 3 +- .../gen/mix/c37ede.wgsl.expected.hlsl | 9 ++- .../gen/mix/c37ede.wgsl.expected.msl | 9 ++- .../gen/mix/c37ede.wgsl.expected.spvasm | 56 +++++++++------ .../gen/mix/c37ede.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/modf/8d6261.wgsl | 3 +- .../gen/modf/8d6261.wgsl.expected.spvasm | 58 +++++++++------ .../gen/modf/8d6261.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/modf/c82e3f.wgsl | 3 +- .../gen/modf/c82e3f.wgsl.expected.spvasm | 58 +++++++++------ .../gen/modf/c82e3f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/modf/d62477.wgsl | 3 +- .../gen/modf/d62477.wgsl.expected.spvasm | 56 +++++++++------ .../gen/modf/d62477.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/modf/f9f98c.wgsl | 3 +- .../gen/modf/f9f98c.wgsl.expected.spvasm | 56 +++++++++------ .../gen/modf/f9f98c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/normalize/64d8c0.wgsl | 3 +- .../gen/normalize/64d8c0.wgsl.expected.hlsl | 9 ++- .../gen/normalize/64d8c0.wgsl.expected.msl | 9 ++- .../gen/normalize/64d8c0.wgsl.expected.spvasm | 54 +++++++++----- .../gen/normalize/64d8c0.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/normalize/9a0aab.wgsl | 3 +- .../gen/normalize/9a0aab.wgsl.expected.hlsl | 9 ++- .../gen/normalize/9a0aab.wgsl.expected.msl | 9 ++- .../gen/normalize/9a0aab.wgsl.expected.spvasm | 56 +++++++++------ .../gen/normalize/9a0aab.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/normalize/fc2ef1.wgsl | 3 +- .../gen/normalize/fc2ef1.wgsl.expected.hlsl | 9 ++- .../gen/normalize/fc2ef1.wgsl.expected.msl | 9 ++- .../gen/normalize/fc2ef1.wgsl.expected.spvasm | 54 +++++++++----- .../gen/normalize/fc2ef1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pack2x16float/0e97b3.wgsl | 3 +- .../pack2x16float/0e97b3.wgsl.expected.hlsl | 9 ++- .../pack2x16float/0e97b3.wgsl.expected.msl | 9 ++- .../pack2x16float/0e97b3.wgsl.expected.spvasm | 56 +++++++++------ .../pack2x16float/0e97b3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pack2x16snorm/6c169b.wgsl | 3 +- .../pack2x16snorm/6c169b.wgsl.expected.hlsl | 9 ++- .../pack2x16snorm/6c169b.wgsl.expected.msl | 9 ++- .../pack2x16snorm/6c169b.wgsl.expected.spvasm | 56 +++++++++------ .../pack2x16snorm/6c169b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl | 3 +- .../pack2x16unorm/0f08e4.wgsl.expected.hlsl | 9 ++- .../pack2x16unorm/0f08e4.wgsl.expected.msl | 9 ++- .../pack2x16unorm/0f08e4.wgsl.expected.spvasm | 56 +++++++++------ .../pack2x16unorm/0f08e4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl | 3 +- .../pack4x8snorm/4d22e7.wgsl.expected.hlsl | 9 ++- .../gen/pack4x8snorm/4d22e7.wgsl.expected.msl | 9 ++- .../pack4x8snorm/4d22e7.wgsl.expected.spvasm | 60 ++++++++++------ .../pack4x8snorm/4d22e7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pack4x8unorm/95c456.wgsl | 3 +- .../pack4x8unorm/95c456.wgsl.expected.hlsl | 9 ++- .../gen/pack4x8unorm/95c456.wgsl.expected.msl | 9 ++- .../pack4x8unorm/95c456.wgsl.expected.spvasm | 60 ++++++++++------ .../pack4x8unorm/95c456.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pow/04a908.wgsl | 3 +- .../gen/pow/04a908.wgsl.expected.hlsl | 9 ++- .../gen/pow/04a908.wgsl.expected.msl | 9 ++- .../gen/pow/04a908.wgsl.expected.spvasm | 56 +++++++++------ .../gen/pow/04a908.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pow/46e029.wgsl | 3 +- .../gen/pow/46e029.wgsl.expected.hlsl | 9 ++- .../gen/pow/46e029.wgsl.expected.msl | 9 ++- .../gen/pow/46e029.wgsl.expected.spvasm | 58 +++++++++------ .../gen/pow/46e029.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pow/4a46c9.wgsl | 3 +- .../gen/pow/4a46c9.wgsl.expected.hlsl | 9 ++- .../gen/pow/4a46c9.wgsl.expected.msl | 9 ++- .../gen/pow/4a46c9.wgsl.expected.spvasm | 54 +++++++++----- .../gen/pow/4a46c9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/pow/e60ea5.wgsl | 3 +- .../gen/pow/e60ea5.wgsl.expected.hlsl | 9 ++- .../gen/pow/e60ea5.wgsl.expected.msl | 9 ++- .../gen/pow/e60ea5.wgsl.expected.spvasm | 54 +++++++++----- .../gen/pow/e60ea5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reflect/05357e.wgsl | 3 +- .../gen/reflect/05357e.wgsl.expected.hlsl | 9 ++- .../gen/reflect/05357e.wgsl.expected.msl | 9 ++- .../gen/reflect/05357e.wgsl.expected.spvasm | 56 +++++++++------ .../gen/reflect/05357e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reflect/b61e10.wgsl | 3 +- .../gen/reflect/b61e10.wgsl.expected.hlsl | 9 ++- .../gen/reflect/b61e10.wgsl.expected.msl | 9 ++- .../gen/reflect/b61e10.wgsl.expected.spvasm | 54 +++++++++----- .../gen/reflect/b61e10.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reflect/f47fdb.wgsl | 3 +- .../gen/reflect/f47fdb.wgsl.expected.hlsl | 9 ++- .../gen/reflect/f47fdb.wgsl.expected.msl | 9 ++- .../gen/reflect/f47fdb.wgsl.expected.spvasm | 54 +++++++++----- .../gen/reflect/f47fdb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reflect/feae90.wgsl | 3 +- .../gen/reflect/feae90.wgsl.expected.hlsl | 9 ++- .../gen/reflect/feae90.wgsl.expected.spvasm | 58 +++++++++------ .../gen/reflect/feae90.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/222177.wgsl | 3 +- .../gen/reverseBits/222177.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/222177.wgsl.expected.msl | 9 ++- .../reverseBits/222177.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/222177.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/35fea9.wgsl | 3 +- .../gen/reverseBits/35fea9.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/35fea9.wgsl.expected.msl | 9 ++- .../reverseBits/35fea9.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/35fea9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/4dbd6f.wgsl | 3 +- .../gen/reverseBits/4dbd6f.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/4dbd6f.wgsl.expected.msl | 9 ++- .../reverseBits/4dbd6f.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/4dbd6f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/7c4269.wgsl | 3 +- .../gen/reverseBits/7c4269.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/7c4269.wgsl.expected.msl | 9 ++- .../reverseBits/7c4269.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/7c4269.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/a6ccd4.wgsl | 3 +- .../gen/reverseBits/a6ccd4.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/a6ccd4.wgsl.expected.msl | 9 ++- .../reverseBits/a6ccd4.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/a6ccd4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/c21bc1.wgsl | 3 +- .../gen/reverseBits/c21bc1.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/c21bc1.wgsl.expected.msl | 9 ++- .../reverseBits/c21bc1.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/c21bc1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/e1f4c1.wgsl | 3 +- .../gen/reverseBits/e1f4c1.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/e1f4c1.wgsl.expected.msl | 9 ++- .../reverseBits/e1f4c1.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/e1f4c1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/reverseBits/e31adf.wgsl | 3 +- .../gen/reverseBits/e31adf.wgsl.expected.hlsl | 9 ++- .../gen/reverseBits/e31adf.wgsl.expected.msl | 9 ++- .../reverseBits/e31adf.wgsl.expected.spvasm | 52 +++++++++----- .../gen/reverseBits/e31adf.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/round/106c0b.wgsl | 3 +- .../gen/round/106c0b.wgsl.expected.hlsl | 9 ++- .../gen/round/106c0b.wgsl.expected.msl | 9 ++- .../gen/round/106c0b.wgsl.expected.spvasm | 56 +++++++++------ .../gen/round/106c0b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/round/1c7897.wgsl | 3 +- .../gen/round/1c7897.wgsl.expected.hlsl | 9 ++- .../gen/round/1c7897.wgsl.expected.msl | 9 ++- .../gen/round/1c7897.wgsl.expected.spvasm | 54 +++++++++----- .../gen/round/1c7897.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/round/52c84d.wgsl | 3 +- .../gen/round/52c84d.wgsl.expected.hlsl | 9 ++- .../gen/round/52c84d.wgsl.expected.msl | 9 ++- .../gen/round/52c84d.wgsl.expected.spvasm | 54 +++++++++----- .../gen/round/52c84d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/round/9edc38.wgsl | 3 +- .../gen/round/9edc38.wgsl.expected.hlsl | 9 ++- .../gen/round/9edc38.wgsl.expected.msl | 9 ++- .../gen/round/9edc38.wgsl.expected.spvasm | 58 +++++++++------ .../gen/round/9edc38.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/00b848.wgsl | 3 +- .../gen/select/00b848.wgsl.expected.msl | 9 ++- .../gen/select/00b848.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/01e2cd.wgsl | 3 +- .../gen/select/01e2cd.wgsl.expected.msl | 9 ++- .../gen/select/01e2cd.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/1e960b.wgsl | 3 +- .../gen/select/1e960b.wgsl.expected.msl | 9 ++- .../gen/select/1e960b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/266aff.wgsl | 3 +- .../gen/select/266aff.wgsl.expected.msl | 9 ++- .../gen/select/266aff.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/28a27e.wgsl | 3 +- .../gen/select/28a27e.wgsl.expected.msl | 9 ++- .../gen/select/28a27e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/416e14.wgsl | 3 +- .../gen/select/416e14.wgsl.expected.msl | 9 ++- .../gen/select/416e14.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/80a9a9.wgsl | 3 +- .../gen/select/80a9a9.wgsl.expected.msl | 9 ++- .../gen/select/80a9a9.wgsl.expected.spvasm | 52 +++++++++----- .../gen/select/80a9a9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/99f883.wgsl | 3 +- .../gen/select/99f883.wgsl.expected.msl | 9 ++- .../gen/select/99f883.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/a2860e.wgsl | 3 +- .../gen/select/a2860e.wgsl.expected.msl | 9 ++- .../gen/select/a2860e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/bb8aae.wgsl | 3 +- .../gen/select/bb8aae.wgsl.expected.msl | 9 ++- .../gen/select/bb8aae.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/c31f9e.wgsl | 3 +- .../gen/select/c31f9e.wgsl.expected.msl | 9 ++- .../gen/select/c31f9e.wgsl.expected.spvasm | 52 +++++++++----- .../gen/select/c31f9e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/c4a4ef.wgsl | 3 +- .../gen/select/c4a4ef.wgsl.expected.msl | 9 ++- .../gen/select/c4a4ef.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/cb9301.wgsl | 3 +- .../gen/select/cb9301.wgsl.expected.msl | 9 ++- .../gen/select/cb9301.wgsl.expected.spvasm | 52 +++++++++----- .../gen/select/cb9301.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/e3e028.wgsl | 3 +- .../gen/select/e3e028.wgsl.expected.msl | 9 ++- .../gen/select/e3e028.wgsl.expected.spvasm | 52 +++++++++----- .../gen/select/e3e028.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/ebfea2.wgsl | 3 +- .../gen/select/ebfea2.wgsl.expected.msl | 9 ++- .../gen/select/ebfea2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/select/ed8a15.wgsl | 3 +- .../gen/select/ed8a15.wgsl.expected.msl | 9 ++- .../gen/select/ed8a15.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sign/159665.wgsl | 3 +- .../gen/sign/159665.wgsl.expected.hlsl | 9 ++- .../gen/sign/159665.wgsl.expected.msl | 9 ++- .../gen/sign/159665.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sign/159665.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sign/b8f634.wgsl | 3 +- .../gen/sign/b8f634.wgsl.expected.hlsl | 9 ++- .../gen/sign/b8f634.wgsl.expected.msl | 9 ++- .../gen/sign/b8f634.wgsl.expected.spvasm | 56 +++++++++------ .../gen/sign/b8f634.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sign/d065d8.wgsl | 3 +- .../gen/sign/d065d8.wgsl.expected.hlsl | 9 ++- .../gen/sign/d065d8.wgsl.expected.msl | 9 ++- .../gen/sign/d065d8.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sign/d065d8.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sign/dd790e.wgsl | 3 +- .../gen/sign/dd790e.wgsl.expected.hlsl | 9 ++- .../gen/sign/dd790e.wgsl.expected.msl | 9 ++- .../gen/sign/dd790e.wgsl.expected.spvasm | 58 +++++++++------ .../gen/sign/dd790e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sin/01f241.wgsl | 3 +- .../gen/sin/01f241.wgsl.expected.hlsl | 9 ++- .../gen/sin/01f241.wgsl.expected.msl | 9 ++- .../gen/sin/01f241.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sin/01f241.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sin/4e3979.wgsl | 3 +- .../gen/sin/4e3979.wgsl.expected.hlsl | 9 ++- .../gen/sin/4e3979.wgsl.expected.msl | 9 ++- .../gen/sin/4e3979.wgsl.expected.spvasm | 56 +++++++++------ .../gen/sin/4e3979.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sin/b78c91.wgsl | 3 +- .../gen/sin/b78c91.wgsl.expected.hlsl | 9 ++- .../gen/sin/b78c91.wgsl.expected.msl | 9 ++- .../gen/sin/b78c91.wgsl.expected.spvasm | 58 +++++++++------ .../gen/sin/b78c91.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sin/fc8bc4.wgsl | 3 +- .../gen/sin/fc8bc4.wgsl.expected.hlsl | 9 ++- .../gen/sin/fc8bc4.wgsl.expected.msl | 9 ++- .../gen/sin/fc8bc4.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sin/fc8bc4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sinh/445e33.wgsl | 3 +- .../gen/sinh/445e33.wgsl.expected.hlsl | 9 ++- .../gen/sinh/445e33.wgsl.expected.msl | 9 ++- .../gen/sinh/445e33.wgsl.expected.spvasm | 56 +++++++++------ .../gen/sinh/445e33.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sinh/7bb598.wgsl | 3 +- .../gen/sinh/7bb598.wgsl.expected.hlsl | 9 ++- .../gen/sinh/7bb598.wgsl.expected.msl | 9 ++- .../gen/sinh/7bb598.wgsl.expected.spvasm | 58 +++++++++------ .../gen/sinh/7bb598.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sinh/b9860e.wgsl | 3 +- .../gen/sinh/b9860e.wgsl.expected.hlsl | 9 ++- .../gen/sinh/b9860e.wgsl.expected.msl | 9 ++- .../gen/sinh/b9860e.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sinh/b9860e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sinh/c9a5eb.wgsl | 3 +- .../gen/sinh/c9a5eb.wgsl.expected.hlsl | 9 ++- .../gen/sinh/c9a5eb.wgsl.expected.msl | 9 ++- .../gen/sinh/c9a5eb.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sinh/c9a5eb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/smoothStep/5f615b.wgsl | 3 +- .../gen/smoothStep/5f615b.wgsl.expected.hlsl | 9 ++- .../gen/smoothStep/5f615b.wgsl.expected.msl | 9 ++- .../smoothStep/5f615b.wgsl.expected.spvasm | 56 +++++++++------ .../gen/smoothStep/5f615b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/smoothStep/658be3.wgsl | 3 +- .../gen/smoothStep/658be3.wgsl.expected.hlsl | 9 ++- .../gen/smoothStep/658be3.wgsl.expected.msl | 9 ++- .../smoothStep/658be3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/smoothStep/658be3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/smoothStep/c11eef.wgsl | 3 +- .../gen/smoothStep/c11eef.wgsl.expected.hlsl | 9 ++- .../gen/smoothStep/c11eef.wgsl.expected.msl | 9 ++- .../smoothStep/c11eef.wgsl.expected.spvasm | 54 +++++++++----- .../gen/smoothStep/c11eef.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/smoothStep/cb0bfb.wgsl | 3 +- .../gen/smoothStep/cb0bfb.wgsl.expected.hlsl | 9 ++- .../gen/smoothStep/cb0bfb.wgsl.expected.msl | 9 ++- .../smoothStep/cb0bfb.wgsl.expected.spvasm | 58 +++++++++------ .../gen/smoothStep/cb0bfb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sqrt/20c74e.wgsl | 3 +- .../gen/sqrt/20c74e.wgsl.expected.hlsl | 9 ++- .../gen/sqrt/20c74e.wgsl.expected.msl | 9 ++- .../gen/sqrt/20c74e.wgsl.expected.spvasm | 58 +++++++++------ .../gen/sqrt/20c74e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sqrt/8c7024.wgsl | 3 +- .../gen/sqrt/8c7024.wgsl.expected.hlsl | 9 ++- .../gen/sqrt/8c7024.wgsl.expected.msl | 9 ++- .../gen/sqrt/8c7024.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sqrt/8c7024.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sqrt/aa0d7a.wgsl | 3 +- .../gen/sqrt/aa0d7a.wgsl.expected.hlsl | 9 ++- .../gen/sqrt/aa0d7a.wgsl.expected.msl | 9 ++- .../gen/sqrt/aa0d7a.wgsl.expected.spvasm | 56 +++++++++------ .../gen/sqrt/aa0d7a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/sqrt/f8c59a.wgsl | 3 +- .../gen/sqrt/f8c59a.wgsl.expected.hlsl | 9 ++- .../gen/sqrt/f8c59a.wgsl.expected.msl | 9 ++- .../gen/sqrt/f8c59a.wgsl.expected.spvasm | 54 +++++++++----- .../gen/sqrt/f8c59a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/step/0b073b.wgsl | 3 +- .../gen/step/0b073b.wgsl.expected.hlsl | 9 ++- .../gen/step/0b073b.wgsl.expected.msl | 9 ++- .../gen/step/0b073b.wgsl.expected.spvasm | 58 +++++++++------ .../gen/step/0b073b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/step/19accd.wgsl | 3 +- .../gen/step/19accd.wgsl.expected.hlsl | 9 ++- .../gen/step/19accd.wgsl.expected.msl | 9 ++- .../gen/step/19accd.wgsl.expected.spvasm | 54 +++++++++----- .../gen/step/19accd.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/step/334303.wgsl | 3 +- .../gen/step/334303.wgsl.expected.hlsl | 9 ++- .../gen/step/334303.wgsl.expected.msl | 9 ++- .../gen/step/334303.wgsl.expected.spvasm | 54 +++++++++----- .../gen/step/334303.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/step/e2b337.wgsl | 3 +- .../gen/step/e2b337.wgsl.expected.hlsl | 9 ++- .../gen/step/e2b337.wgsl.expected.msl | 9 ++- .../gen/step/e2b337.wgsl.expected.spvasm | 56 +++++++++------ .../gen/step/e2b337.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tan/244e2a.wgsl | 3 +- .../gen/tan/244e2a.wgsl.expected.hlsl | 9 ++- .../gen/tan/244e2a.wgsl.expected.msl | 9 ++- .../gen/tan/244e2a.wgsl.expected.spvasm | 56 +++++++++------ .../gen/tan/244e2a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tan/2f030e.wgsl | 3 +- .../gen/tan/2f030e.wgsl.expected.hlsl | 9 ++- .../gen/tan/2f030e.wgsl.expected.msl | 9 ++- .../gen/tan/2f030e.wgsl.expected.spvasm | 58 +++++++++------ .../gen/tan/2f030e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tan/7ea104.wgsl | 3 +- .../gen/tan/7ea104.wgsl.expected.hlsl | 9 ++- .../gen/tan/7ea104.wgsl.expected.msl | 9 ++- .../gen/tan/7ea104.wgsl.expected.spvasm | 54 +++++++++----- .../gen/tan/7ea104.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tan/8ce3e9.wgsl | 3 +- .../gen/tan/8ce3e9.wgsl.expected.hlsl | 9 ++- .../gen/tan/8ce3e9.wgsl.expected.msl | 9 ++- .../gen/tan/8ce3e9.wgsl.expected.spvasm | 54 +++++++++----- .../gen/tan/8ce3e9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tanh/5663c5.wgsl | 3 +- .../gen/tanh/5663c5.wgsl.expected.hlsl | 9 ++- .../gen/tanh/5663c5.wgsl.expected.msl | 9 ++- .../gen/tanh/5663c5.wgsl.expected.spvasm | 56 +++++++++------ .../gen/tanh/5663c5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tanh/5724b3.wgsl | 3 +- .../gen/tanh/5724b3.wgsl.expected.hlsl | 9 ++- .../gen/tanh/5724b3.wgsl.expected.msl | 9 ++- .../gen/tanh/5724b3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/tanh/5724b3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tanh/9f9fb9.wgsl | 3 +- .../gen/tanh/9f9fb9.wgsl.expected.hlsl | 9 ++- .../gen/tanh/9f9fb9.wgsl.expected.msl | 9 ++- .../gen/tanh/9f9fb9.wgsl.expected.spvasm | 54 +++++++++----- .../gen/tanh/9f9fb9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/tanh/c15fdb.wgsl | 3 +- .../gen/tanh/c15fdb.wgsl.expected.hlsl | 9 ++- .../gen/tanh/c15fdb.wgsl.expected.msl | 9 ++- .../gen/tanh/c15fdb.wgsl.expected.spvasm | 58 +++++++++------ .../gen/tanh/c15fdb.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/002b2a.wgsl | 3 +- .../002b2a.wgsl.expected.hlsl | 9 ++- .../002b2a.wgsl.expected.spvasm | 54 +++++++++----- .../002b2a.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/012b82.wgsl | 3 +- .../012b82.wgsl.expected.hlsl | 9 ++- .../012b82.wgsl.expected.spvasm | 56 +++++++++------ .../012b82.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/08753d.wgsl | 3 +- .../08753d.wgsl.expected.hlsl | 9 ++- .../08753d.wgsl.expected.spvasm | 54 +++++++++----- .../08753d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/08a62e.wgsl | 3 +- .../08a62e.wgsl.expected.hlsl | 9 ++- .../08a62e.wgsl.expected.spvasm | 54 +++++++++----- .../08a62e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0a5fcf.wgsl | 3 +- .../0a5fcf.wgsl.expected.hlsl | 9 ++- .../0a5fcf.wgsl.expected.spvasm | 56 +++++++++------ .../0a5fcf.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0bab57.wgsl | 3 +- .../0bab57.wgsl.expected.hlsl | 9 ++- .../0bab57.wgsl.expected.spvasm | 54 +++++++++----- .../0bab57.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0c4772.wgsl | 3 +- .../0c4772.wgsl.expected.hlsl | 9 ++- .../0c4772.wgsl.expected.spvasm | 54 +++++++++----- .../0c4772.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0cce40.wgsl | 3 +- .../0cce40.wgsl.expected.hlsl | 9 ++- .../0cce40.wgsl.expected.spvasm | 54 +++++++++----- .../0cce40.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0cf2ff.wgsl | 3 +- .../0cf2ff.wgsl.expected.hlsl | 9 ++- .../0cf2ff.wgsl.expected.spvasm | 54 +++++++++----- .../0cf2ff.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0d8b7e.wgsl | 3 +- .../0d8b7e.wgsl.expected.hlsl | 9 ++- .../0d8b7e.wgsl.expected.spvasm | 56 +++++++++------ .../0d8b7e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0e32ee.wgsl | 3 +- .../0e32ee.wgsl.expected.hlsl | 9 ++- .../0e32ee.wgsl.expected.spvasm | 54 +++++++++----- .../0e32ee.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/0f3c50.wgsl | 3 +- .../0f3c50.wgsl.expected.hlsl | 9 ++- .../0f3c50.wgsl.expected.spvasm | 56 +++++++++------ .../0f3c50.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1147d6.wgsl | 3 +- .../1147d6.wgsl.expected.hlsl | 9 ++- .../1147d6.wgsl.expected.spvasm | 56 +++++++++------ .../1147d6.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1191a5.wgsl | 3 +- .../1191a5.wgsl.expected.hlsl | 9 ++- .../1191a5.wgsl.expected.spvasm | 54 +++++++++----- .../1191a5.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/12c9bb.wgsl | 3 +- .../12c9bb.wgsl.expected.hlsl | 9 ++- .../12c9bb.wgsl.expected.spvasm | 54 +++++++++----- .../12c9bb.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/147998.wgsl | 3 +- .../147998.wgsl.expected.hlsl | 9 ++- .../147998.wgsl.expected.spvasm | 54 +++++++++----- .../147998.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/16036c.wgsl | 3 +- .../16036c.wgsl.expected.hlsl | 9 ++- .../16036c.wgsl.expected.spvasm | 56 +++++++++------ .../16036c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/168fcc.wgsl | 3 +- .../168fcc.wgsl.expected.hlsl | 9 ++- .../168fcc.wgsl.expected.spvasm | 54 +++++++++----- .../168fcc.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/183b3e.wgsl | 3 +- .../183b3e.wgsl.expected.hlsl | 9 ++- .../183b3e.wgsl.expected.spvasm | 56 +++++++++------ .../183b3e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/18bd57.wgsl | 3 +- .../18bd57.wgsl.expected.hlsl | 9 ++- .../18bd57.wgsl.expected.spvasm | 56 +++++++++------ .../18bd57.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/19bffc.wgsl | 3 +- .../19bffc.wgsl.expected.hlsl | 9 ++- .../19bffc.wgsl.expected.spvasm | 54 +++++++++----- .../19bffc.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1a58e7.wgsl | 3 +- .../1a58e7.wgsl.expected.hlsl | 9 ++- .../1a58e7.wgsl.expected.spvasm | 56 +++++++++------ .../1a58e7.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1aa199.wgsl | 3 +- .../1aa199.wgsl.expected.hlsl | 9 ++- .../1aa199.wgsl.expected.spvasm | 56 +++++++++------ .../1aa199.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1b71f0.wgsl | 3 +- .../1b71f0.wgsl.expected.hlsl | 9 ++- .../1b71f0.wgsl.expected.spvasm | 54 +++++++++----- .../1b71f0.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1d6c26.wgsl | 3 +- .../1d6c26.wgsl.expected.hlsl | 9 ++- .../1d6c26.wgsl.expected.spvasm | 56 +++++++++------ .../1d6c26.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1e189c.wgsl | 3 +- .../1e189c.wgsl.expected.hlsl | 9 ++- .../1e189c.wgsl.expected.spvasm | 54 +++++++++----- .../1e189c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1e9e39.wgsl | 3 +- .../1e9e39.wgsl.expected.hlsl | 9 ++- .../1e9e39.wgsl.expected.spvasm | 54 +++++++++----- .../1e9e39.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1ebd6a.wgsl | 3 +- .../1ebd6a.wgsl.expected.hlsl | 9 ++- .../1ebd6a.wgsl.expected.spvasm | 56 +++++++++------ .../1ebd6a.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/1f20c5.wgsl | 3 +- .../1f20c5.wgsl.expected.hlsl | 9 ++- .../1f20c5.wgsl.expected.spvasm | 56 +++++++++------ .../1f20c5.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/214b7b.wgsl | 3 +- .../214b7b.wgsl.expected.hlsl | 9 ++- .../214b7b.wgsl.expected.spvasm | 54 +++++++++----- .../214b7b.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/214dd4.wgsl | 3 +- .../214dd4.wgsl.expected.hlsl | 9 ++- .../214dd4.wgsl.expected.spvasm | 54 +++++++++----- .../214dd4.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/267788.wgsl | 3 +- .../267788.wgsl.expected.hlsl | 9 ++- .../267788.wgsl.expected.spvasm | 56 +++++++++------ .../267788.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/26bdfa.wgsl | 3 +- .../26bdfa.wgsl.expected.hlsl | 9 ++- .../26bdfa.wgsl.expected.spvasm | 54 +++++++++----- .../26bdfa.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/26ef6c.wgsl | 3 +- .../26ef6c.wgsl.expected.hlsl | 9 ++- .../26ef6c.wgsl.expected.spvasm | 56 +++++++++------ .../26ef6c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/2ad087.wgsl | 3 +- .../2ad087.wgsl.expected.hlsl | 9 ++- .../2ad087.wgsl.expected.spvasm | 54 +++++++++----- .../2ad087.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/2d32ae.wgsl | 3 +- .../2d32ae.wgsl.expected.hlsl | 9 ++- .../2d32ae.wgsl.expected.spvasm | 54 +++++++++----- .../2d32ae.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/2e0662.wgsl | 3 +- .../2e0662.wgsl.expected.hlsl | 9 ++- .../2e0662.wgsl.expected.spvasm | 54 +++++++++----- .../2e0662.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/2efa05.wgsl | 3 +- .../2efa05.wgsl.expected.hlsl | 9 ++- .../2efa05.wgsl.expected.spvasm | 54 +++++++++----- .../2efa05.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/2f289f.wgsl | 3 +- .../2f289f.wgsl.expected.hlsl | 9 ++- .../2f289f.wgsl.expected.spvasm | 54 +++++++++----- .../2f289f.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/2fe1cc.wgsl | 3 +- .../2fe1cc.wgsl.expected.hlsl | 9 ++- .../2fe1cc.wgsl.expected.spvasm | 54 +++++++++----- .../2fe1cc.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/318ecc.wgsl | 3 +- .../318ecc.wgsl.expected.hlsl | 9 ++- .../318ecc.wgsl.expected.spvasm | 54 +++++++++----- .../318ecc.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/340d06.wgsl | 3 +- .../340d06.wgsl.expected.hlsl | 9 ++- .../340d06.wgsl.expected.spvasm | 54 +++++++++----- .../340d06.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/398e30.wgsl | 3 +- .../398e30.wgsl.expected.hlsl | 9 ++- .../398e30.wgsl.expected.spvasm | 56 +++++++++------ .../398e30.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/39a600.wgsl | 3 +- .../39a600.wgsl.expected.hlsl | 9 ++- .../39a600.wgsl.expected.spvasm | 56 +++++++++------ .../39a600.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/3a94ea.wgsl | 3 +- .../3a94ea.wgsl.expected.hlsl | 9 ++- .../3a94ea.wgsl.expected.spvasm | 54 +++++++++----- .../3a94ea.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/3aca08.wgsl | 3 +- .../3aca08.wgsl.expected.hlsl | 9 ++- .../3aca08.wgsl.expected.spvasm | 54 +++++++++----- .../3aca08.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/3c5ad8.wgsl | 3 +- .../3c5ad8.wgsl.expected.hlsl | 9 ++- .../3c5ad8.wgsl.expected.spvasm | 54 +++++++++----- .../3c5ad8.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/3d5817.wgsl | 3 +- .../3d5817.wgsl.expected.hlsl | 9 ++- .../3d5817.wgsl.expected.spvasm | 54 +++++++++----- .../3d5817.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/3e0403.wgsl | 3 +- .../3e0403.wgsl.expected.hlsl | 9 ++- .../3e0403.wgsl.expected.spvasm | 56 +++++++++------ .../3e0403.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/3e626d.wgsl | 3 +- .../3e626d.wgsl.expected.hlsl | 9 ++- .../3e626d.wgsl.expected.spvasm | 56 +++++++++------ .../3e626d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/40bc10.wgsl | 3 +- .../40bc10.wgsl.expected.hlsl | 9 ++- .../40bc10.wgsl.expected.spvasm | 54 +++++++++----- .../40bc10.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/423f99.wgsl | 3 +- .../423f99.wgsl.expected.hlsl | 9 ++- .../423f99.wgsl.expected.spvasm | 54 +++++++++----- .../423f99.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/4267ee.wgsl | 3 +- .../4267ee.wgsl.expected.hlsl | 9 ++- .../4267ee.wgsl.expected.spvasm | 54 +++++++++----- .../4267ee.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/42d4e6.wgsl | 3 +- .../42d4e6.wgsl.expected.hlsl | 9 ++- .../42d4e6.wgsl.expected.spvasm | 54 +++++++++----- .../42d4e6.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/441392.wgsl | 3 +- .../441392.wgsl.expected.hlsl | 9 ++- .../441392.wgsl.expected.spvasm | 54 +++++++++----- .../441392.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/48cb89.wgsl | 3 +- .../48cb89.wgsl.expected.hlsl | 9 ++- .../48cb89.wgsl.expected.spvasm | 54 +++++++++----- .../48cb89.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/48cbb2.wgsl | 3 +- .../48cbb2.wgsl.expected.hlsl | 9 ++- .../48cbb2.wgsl.expected.spvasm | 56 +++++++++------ .../48cbb2.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/48f360.wgsl | 3 +- .../48f360.wgsl.expected.hlsl | 9 ++- .../48f360.wgsl.expected.spvasm | 54 +++++++++----- .../48f360.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/49d274.wgsl | 3 +- .../49d274.wgsl.expected.hlsl | 9 ++- .../49d274.wgsl.expected.spvasm | 56 +++++++++------ .../49d274.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/4df9a8.wgsl | 3 +- .../4df9a8.wgsl.expected.hlsl | 9 ++- .../4df9a8.wgsl.expected.spvasm | 54 +++++++++----- .../4df9a8.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/55b23e.wgsl | 3 +- .../55b23e.wgsl.expected.hlsl | 9 ++- .../55b23e.wgsl.expected.spvasm | 54 +++++++++----- .../55b23e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/56ccfa.wgsl | 3 +- .../56ccfa.wgsl.expected.hlsl | 9 ++- .../56ccfa.wgsl.expected.spvasm | 54 +++++++++----- .../56ccfa.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/579629.wgsl | 3 +- .../579629.wgsl.expected.hlsl | 9 ++- .../579629.wgsl.expected.spvasm | 54 +++++++++----- .../579629.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/57da0b.wgsl | 3 +- .../57da0b.wgsl.expected.hlsl | 9 ++- .../57da0b.wgsl.expected.spvasm | 54 +++++++++----- .../57da0b.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/57e7b3.wgsl | 3 +- .../57e7b3.wgsl.expected.hlsl | 9 ++- .../57e7b3.wgsl.expected.spvasm | 54 +++++++++----- .../57e7b3.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/58a515.wgsl | 3 +- .../58a515.wgsl.expected.hlsl | 9 ++- .../58a515.wgsl.expected.spvasm | 56 +++++++++------ .../58a515.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/5985f3.wgsl | 3 +- .../5985f3.wgsl.expected.hlsl | 9 ++- .../5985f3.wgsl.expected.spvasm | 56 +++++++++------ .../5985f3.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/5caa5e.wgsl | 3 +- .../5caa5e.wgsl.expected.hlsl | 9 ++- .../5caa5e.wgsl.expected.spvasm | 54 +++++++++----- .../5caa5e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/5e295d.wgsl | 3 +- .../5e295d.wgsl.expected.hlsl | 9 ++- .../5e295d.wgsl.expected.spvasm | 56 +++++++++------ .../5e295d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/5ec4e1.wgsl | 3 +- .../5ec4e1.wgsl.expected.hlsl | 9 ++- .../5ec4e1.wgsl.expected.spvasm | 56 +++++++++------ .../5ec4e1.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/60bf54.wgsl | 3 +- .../60bf54.wgsl.expected.hlsl | 9 ++- .../60bf54.wgsl.expected.spvasm | 54 +++++++++----- .../60bf54.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/63f3cf.wgsl | 3 +- .../63f3cf.wgsl.expected.hlsl | 9 ++- .../63f3cf.wgsl.expected.spvasm | 54 +++++++++----- .../63f3cf.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/66dc4e.wgsl | 3 +- .../66dc4e.wgsl.expected.hlsl | 9 ++- .../66dc4e.wgsl.expected.spvasm | 56 +++++++++------ .../66dc4e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/670d90.wgsl | 3 +- .../670d90.wgsl.expected.hlsl | 9 ++- .../670d90.wgsl.expected.spvasm | 54 +++++++++----- .../670d90.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/68105c.wgsl | 3 +- .../68105c.wgsl.expected.hlsl | 9 ++- .../68105c.wgsl.expected.spvasm | 54 +++++++++----- .../68105c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/6adac6.wgsl | 3 +- .../6adac6.wgsl.expected.hlsl | 9 ++- .../6adac6.wgsl.expected.spvasm | 54 +++++++++----- .../6adac6.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/6c08ab.wgsl | 3 +- .../6c08ab.wgsl.expected.hlsl | 9 ++- .../6c08ab.wgsl.expected.spvasm | 54 +++++++++----- .../6c08ab.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/6e2d12.wgsl | 3 +- .../6e2d12.wgsl.expected.hlsl | 9 ++- .../6e2d12.wgsl.expected.spvasm | 54 +++++++++----- .../6e2d12.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/6ec1b4.wgsl | 3 +- .../6ec1b4.wgsl.expected.hlsl | 9 ++- .../6ec1b4.wgsl.expected.spvasm | 54 +++++++++----- .../6ec1b4.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/6f0d79.wgsl | 3 +- .../6f0d79.wgsl.expected.hlsl | 9 ++- .../6f0d79.wgsl.expected.spvasm | 56 +++++++++------ .../6f0d79.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/702c53.wgsl | 3 +- .../702c53.wgsl.expected.hlsl | 9 ++- .../702c53.wgsl.expected.spvasm | 54 +++++++++----- .../702c53.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/70e26a.wgsl | 3 +- .../70e26a.wgsl.expected.hlsl | 9 ++- .../70e26a.wgsl.expected.spvasm | 54 +++++++++----- .../70e26a.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/71e8f7.wgsl | 3 +- .../71e8f7.wgsl.expected.hlsl | 9 ++- .../71e8f7.wgsl.expected.spvasm | 54 +++++++++----- .../71e8f7.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/72e5d6.wgsl | 3 +- .../72e5d6.wgsl.expected.hlsl | 9 ++- .../72e5d6.wgsl.expected.spvasm | 56 +++++++++------ .../72e5d6.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/75be9d.wgsl | 3 +- .../75be9d.wgsl.expected.hlsl | 9 ++- .../75be9d.wgsl.expected.spvasm | 56 +++++++++------ .../75be9d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/76e722.wgsl | 3 +- .../76e722.wgsl.expected.hlsl | 9 ++- .../76e722.wgsl.expected.spvasm | 56 +++++++++------ .../76e722.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/770103.wgsl | 3 +- .../770103.wgsl.expected.hlsl | 9 ++- .../770103.wgsl.expected.spvasm | 54 +++++++++----- .../770103.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/7bb707.wgsl | 3 +- .../7bb707.wgsl.expected.hlsl | 9 ++- .../7bb707.wgsl.expected.spvasm | 56 +++++++++------ .../7bb707.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/7bf826.wgsl | 3 +- .../7bf826.wgsl.expected.hlsl | 9 ++- .../7bf826.wgsl.expected.spvasm | 56 +++++++++------ .../7bf826.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/7f5c2e.wgsl | 3 +- .../7f5c2e.wgsl.expected.hlsl | 9 ++- .../7f5c2e.wgsl.expected.spvasm | 54 +++++++++----- .../7f5c2e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8028f3.wgsl | 3 +- .../8028f3.wgsl.expected.hlsl | 9 ++- .../8028f3.wgsl.expected.spvasm | 54 +++++++++----- .../8028f3.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/811679.wgsl | 3 +- .../811679.wgsl.expected.hlsl | 9 ++- .../811679.wgsl.expected.spvasm | 54 +++++++++----- .../811679.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/820596.wgsl | 3 +- .../820596.wgsl.expected.hlsl | 9 ++- .../820596.wgsl.expected.spvasm | 54 +++++++++----- .../820596.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/82138e.wgsl | 3 +- .../82138e.wgsl.expected.hlsl | 9 ++- .../82138e.wgsl.expected.spvasm | 54 +++++++++----- .../82138e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8347ab.wgsl | 3 +- .../8347ab.wgsl.expected.hlsl | 9 ++- .../8347ab.wgsl.expected.spvasm | 54 +++++++++----- .../8347ab.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/83ee5a.wgsl | 3 +- .../83ee5a.wgsl.expected.hlsl | 9 ++- .../83ee5a.wgsl.expected.spvasm | 54 +++++++++----- .../83ee5a.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/85d556.wgsl | 3 +- .../85d556.wgsl.expected.hlsl | 9 ++- .../85d556.wgsl.expected.spvasm | 56 +++++++++------ .../85d556.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8799ee.wgsl | 3 +- .../8799ee.wgsl.expected.hlsl | 9 ++- .../8799ee.wgsl.expected.spvasm | 54 +++++++++----- .../8799ee.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/89a864.wgsl | 3 +- .../89a864.wgsl.expected.hlsl | 9 ++- .../89a864.wgsl.expected.spvasm | 54 +++++++++----- .../89a864.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8aa4c4.wgsl | 3 +- .../8aa4c4.wgsl.expected.hlsl | 9 ++- .../8aa4c4.wgsl.expected.spvasm | 54 +++++++++----- .../8aa4c4.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8b4fff.wgsl | 3 +- .../8b4fff.wgsl.expected.hlsl | 9 ++- .../8b4fff.wgsl.expected.spvasm | 54 +++++++++----- .../8b4fff.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8d89f8.wgsl | 3 +- .../8d89f8.wgsl.expected.hlsl | 9 ++- .../8d89f8.wgsl.expected.spvasm | 54 +++++++++----- .../8d89f8.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8deb5e.wgsl | 3 +- .../8deb5e.wgsl.expected.hlsl | 9 ++- .../8deb5e.wgsl.expected.spvasm | 54 +++++++++----- .../8deb5e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/8fca0f.wgsl | 3 +- .../8fca0f.wgsl.expected.hlsl | 9 ++- .../8fca0f.wgsl.expected.spvasm | 54 +++++++++----- .../8fca0f.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9042ab.wgsl | 3 +- .../9042ab.wgsl.expected.hlsl | 9 ++- .../9042ab.wgsl.expected.spvasm | 56 +++++++++------ .../9042ab.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/91f42d.wgsl | 3 +- .../91f42d.wgsl.expected.hlsl | 9 ++- .../91f42d.wgsl.expected.spvasm | 56 +++++++++------ .../91f42d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/924742.wgsl | 3 +- .../924742.wgsl.expected.hlsl | 9 ++- .../924742.wgsl.expected.spvasm | 54 +++++++++----- .../924742.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/92ad20.wgsl | 3 +- .../92ad20.wgsl.expected.hlsl | 9 ++- .../92ad20.wgsl.expected.spvasm | 54 +++++++++----- .../92ad20.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/939fdb.wgsl | 3 +- .../939fdb.wgsl.expected.hlsl | 9 ++- .../939fdb.wgsl.expected.spvasm | 54 +++++++++----- .../939fdb.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9572e5.wgsl | 3 +- .../9572e5.wgsl.expected.hlsl | 9 ++- .../9572e5.wgsl.expected.spvasm | 54 +++++++++----- .../9572e5.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/998f6b.wgsl | 3 +- .../998f6b.wgsl.expected.hlsl | 9 ++- .../998f6b.wgsl.expected.spvasm | 56 +++++++++------ .../998f6b.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9abfe5.wgsl | 3 +- .../9abfe5.wgsl.expected.hlsl | 9 ++- .../9abfe5.wgsl.expected.spvasm | 56 +++++++++------ .../9abfe5.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9c9c57.wgsl | 3 +- .../9c9c57.wgsl.expected.hlsl | 9 ++- .../9c9c57.wgsl.expected.spvasm | 56 +++++++++------ .../9c9c57.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9da9e2.wgsl | 3 +- .../9da9e2.wgsl.expected.hlsl | 9 ++- .../9da9e2.wgsl.expected.spvasm | 54 +++++++++----- .../9da9e2.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9eb8d8.wgsl | 3 +- .../9eb8d8.wgsl.expected.hlsl | 9 ++- .../9eb8d8.wgsl.expected.spvasm | 54 +++++++++----- .../9eb8d8.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/9f8e46.wgsl | 3 +- .../9f8e46.wgsl.expected.hlsl | 9 ++- .../9f8e46.wgsl.expected.spvasm | 54 +++++++++----- .../9f8e46.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/a0aad1.wgsl | 3 +- .../a0aad1.wgsl.expected.hlsl | 9 ++- .../a0aad1.wgsl.expected.spvasm | 54 +++++++++----- .../a0aad1.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/a0e4ec.wgsl | 3 +- .../a0e4ec.wgsl.expected.hlsl | 9 ++- .../a0e4ec.wgsl.expected.spvasm | 54 +++++++++----- .../a0e4ec.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/a6ca1c.wgsl | 3 +- .../a6ca1c.wgsl.expected.hlsl | 9 ++- .../a6ca1c.wgsl.expected.spvasm | 56 +++++++++------ .../a6ca1c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/a7d565.wgsl | 3 +- .../a7d565.wgsl.expected.hlsl | 9 ++- .../a7d565.wgsl.expected.spvasm | 54 +++++++++----- .../a7d565.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/a863f2.wgsl | 3 +- .../a863f2.wgsl.expected.hlsl | 9 ++- .../a863f2.wgsl.expected.spvasm | 54 +++++++++----- .../a863f2.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/ae457f.wgsl | 3 +- .../ae457f.wgsl.expected.hlsl | 9 ++- .../ae457f.wgsl.expected.spvasm | 56 +++++++++------ .../ae457f.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/b0e16d.wgsl | 3 +- .../b0e16d.wgsl.expected.hlsl | 9 ++- .../b0e16d.wgsl.expected.spvasm | 54 +++++++++----- .../b0e16d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/b91240.wgsl | 3 +- .../b91240.wgsl.expected.hlsl | 9 ++- .../b91240.wgsl.expected.spvasm | 54 +++++++++----- .../b91240.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/ba1481.wgsl | 3 +- .../ba1481.wgsl.expected.hlsl | 9 ++- .../ba1481.wgsl.expected.spvasm | 54 +++++++++----- .../ba1481.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/ba6e15.wgsl | 3 +- .../ba6e15.wgsl.expected.hlsl | 9 ++- .../ba6e15.wgsl.expected.spvasm | 54 +++++++++----- .../ba6e15.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/bb3dde.wgsl | 3 +- .../bb3dde.wgsl.expected.hlsl | 9 ++- .../bb3dde.wgsl.expected.spvasm | 54 +++++++++----- .../bb3dde.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/bdf2ee.wgsl | 3 +- .../bdf2ee.wgsl.expected.hlsl | 9 ++- .../bdf2ee.wgsl.expected.spvasm | 56 +++++++++------ .../bdf2ee.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/c2215f.wgsl | 3 +- .../c2215f.wgsl.expected.hlsl | 9 ++- .../c2215f.wgsl.expected.spvasm | 56 +++++++++------ .../c2215f.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/c30e75.wgsl | 3 +- .../c30e75.wgsl.expected.hlsl | 9 ++- .../c30e75.wgsl.expected.spvasm | 54 +++++++++----- .../c30e75.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/c60b66.wgsl | 3 +- .../c60b66.wgsl.expected.hlsl | 9 ++- .../c60b66.wgsl.expected.spvasm | 54 +++++++++----- .../c60b66.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/c74533.wgsl | 3 +- .../c74533.wgsl.expected.hlsl | 9 ++- .../c74533.wgsl.expected.spvasm | 54 +++++++++----- .../c74533.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/c7943d.wgsl | 3 +- .../c7943d.wgsl.expected.hlsl | 9 ++- .../c7943d.wgsl.expected.spvasm | 54 +++++++++----- .../c7943d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/caaabb.wgsl | 3 +- .../caaabb.wgsl.expected.hlsl | 9 ++- .../caaabb.wgsl.expected.spvasm | 56 +++++++++------ .../caaabb.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cc5478.wgsl | 3 +- .../cc5478.wgsl.expected.hlsl | 9 ++- .../cc5478.wgsl.expected.spvasm | 54 +++++++++----- .../cc5478.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cc968c.wgsl | 3 +- .../cc968c.wgsl.expected.hlsl | 9 ++- .../cc968c.wgsl.expected.spvasm | 54 +++++++++----- .../cc968c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cccc17.wgsl | 3 +- .../cccc17.wgsl.expected.hlsl | 9 ++- .../cccc17.wgsl.expected.spvasm | 56 +++++++++------ .../cccc17.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cccc8f.wgsl | 3 +- .../cccc8f.wgsl.expected.hlsl | 9 ++- .../cccc8f.wgsl.expected.spvasm | 54 +++++++++----- .../cccc8f.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cd76a7.wgsl | 3 +- .../cd76a7.wgsl.expected.hlsl | 9 ++- .../cd76a7.wgsl.expected.spvasm | 54 +++++++++----- .../cd76a7.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cdaff9.wgsl | 3 +- .../cdaff9.wgsl.expected.hlsl | 9 ++- .../cdaff9.wgsl.expected.spvasm | 54 +++++++++----- .../cdaff9.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cdf473.wgsl | 3 +- .../cdf473.wgsl.expected.hlsl | 9 ++- .../cdf473.wgsl.expected.spvasm | 56 +++++++++------ .../cdf473.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cec841.wgsl | 3 +- .../cec841.wgsl.expected.hlsl | 9 ++- .../cec841.wgsl.expected.spvasm | 56 +++++++++------ .../cec841.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cf1d42.wgsl | 3 +- .../cf1d42.wgsl.expected.hlsl | 9 ++- .../cf1d42.wgsl.expected.spvasm | 54 +++++++++----- .../cf1d42.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/cf7e43.wgsl | 3 +- .../cf7e43.wgsl.expected.hlsl | 9 ++- .../cf7e43.wgsl.expected.spvasm | 54 +++++++++----- .../cf7e43.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/d40b9e.wgsl | 3 +- .../d40b9e.wgsl.expected.hlsl | 9 ++- .../d40b9e.wgsl.expected.spvasm | 54 +++++++++----- .../d40b9e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/d4106f.wgsl | 3 +- .../d4106f.wgsl.expected.hlsl | 9 ++- .../d4106f.wgsl.expected.spvasm | 54 +++++++++----- .../d4106f.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/d8f951.wgsl | 3 +- .../d8f951.wgsl.expected.hlsl | 9 ++- .../d8f951.wgsl.expected.spvasm | 54 +++++++++----- .../d8f951.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/da3099.wgsl | 3 +- .../da3099.wgsl.expected.hlsl | 9 ++- .../da3099.wgsl.expected.spvasm | 54 +++++++++----- .../da3099.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/daf7c0.wgsl | 3 +- .../daf7c0.wgsl.expected.hlsl | 9 ++- .../daf7c0.wgsl.expected.spvasm | 54 +++++++++----- .../daf7c0.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/dba47c.wgsl | 3 +- .../dba47c.wgsl.expected.hlsl | 9 ++- .../dba47c.wgsl.expected.spvasm | 54 +++++++++----- .../dba47c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/dc2dd0.wgsl | 3 +- .../dc2dd0.wgsl.expected.hlsl | 9 ++- .../dc2dd0.wgsl.expected.spvasm | 54 +++++++++----- .../dc2dd0.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e10157.wgsl | 3 +- .../e10157.wgsl.expected.hlsl | 9 ++- .../e10157.wgsl.expected.spvasm | 54 +++++++++----- .../e10157.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e22247.wgsl | 3 +- .../e22247.wgsl.expected.hlsl | 9 ++- .../e22247.wgsl.expected.spvasm | 56 +++++++++------ .../e22247.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e93464.wgsl | 3 +- .../e93464.wgsl.expected.hlsl | 9 ++- .../e93464.wgsl.expected.spvasm | 54 +++++++++----- .../e93464.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e9628c.wgsl | 3 +- .../e9628c.wgsl.expected.hlsl | 9 ++- .../e9628c.wgsl.expected.spvasm | 56 +++++++++------ .../e9628c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e9e96c.wgsl | 3 +- .../e9e96c.wgsl.expected.hlsl | 9 ++- .../e9e96c.wgsl.expected.spvasm | 56 +++++++++------ .../e9e96c.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e9fe54.wgsl | 3 +- .../e9fe54.wgsl.expected.hlsl | 9 ++- .../e9fe54.wgsl.expected.spvasm | 54 +++++++++----- .../e9fe54.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/e9fe58.wgsl | 3 +- .../e9fe58.wgsl.expected.hlsl | 9 ++- .../e9fe58.wgsl.expected.spvasm | 56 +++++++++------ .../e9fe58.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/eda4e3.wgsl | 3 +- .../eda4e3.wgsl.expected.hlsl | 9 ++- .../eda4e3.wgsl.expected.spvasm | 56 +++++++++------ .../eda4e3.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/ef5b89.wgsl | 3 +- .../ef5b89.wgsl.expected.hlsl | 9 ++- .../ef5b89.wgsl.expected.spvasm | 54 +++++++++----- .../ef5b89.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/efc8a4.wgsl | 3 +- .../efc8a4.wgsl.expected.hlsl | 9 ++- .../efc8a4.wgsl.expected.spvasm | 54 +++++++++----- .../efc8a4.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f1b72b.wgsl | 3 +- .../f1b72b.wgsl.expected.hlsl | 9 ++- .../f1b72b.wgsl.expected.spvasm | 54 +++++++++----- .../f1b72b.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f507c9.wgsl | 3 +- .../f507c9.wgsl.expected.hlsl | 9 ++- .../f507c9.wgsl.expected.spvasm | 56 +++++++++------ .../f507c9.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f70326.wgsl | 3 +- .../f70326.wgsl.expected.hlsl | 9 ++- .../f70326.wgsl.expected.spvasm | 56 +++++++++------ .../f70326.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f7145b.wgsl | 3 +- .../f7145b.wgsl.expected.hlsl | 9 ++- .../f7145b.wgsl.expected.spvasm | 54 +++++++++----- .../f7145b.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f7aa9e.wgsl | 3 +- .../f7aa9e.wgsl.expected.hlsl | 9 ++- .../f7aa9e.wgsl.expected.spvasm | 56 +++++++++------ .../f7aa9e.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f7e436.wgsl | 3 +- .../f7e436.wgsl.expected.hlsl | 9 ++- .../f7e436.wgsl.expected.spvasm | 56 +++++++++------ .../f7e436.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/f931c7.wgsl | 3 +- .../f931c7.wgsl.expected.hlsl | 9 ++- .../f931c7.wgsl.expected.spvasm | 54 +++++++++----- .../f931c7.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/fa90e1.wgsl | 3 +- .../fa90e1.wgsl.expected.hlsl | 9 ++- .../fa90e1.wgsl.expected.spvasm | 54 +++++++++----- .../fa90e1.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/fa9859.wgsl | 3 +- .../fa9859.wgsl.expected.hlsl | 9 ++- .../fa9859.wgsl.expected.spvasm | 54 +++++++++----- .../fa9859.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/fb5670.wgsl | 3 +- .../fb5670.wgsl.expected.hlsl | 9 ++- .../fb5670.wgsl.expected.spvasm | 56 +++++++++------ .../fb5670.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/fbbe4d.wgsl | 3 +- .../fbbe4d.wgsl.expected.hlsl | 9 ++- .../fbbe4d.wgsl.expected.spvasm | 54 +++++++++----- .../fbbe4d.wgsl.expected.wgsl | 3 +- .../gen/textureDimensions/fcac78.wgsl | 3 +- .../fcac78.wgsl.expected.hlsl | 9 ++- .../fcac78.wgsl.expected.spvasm | 54 +++++++++----- .../fcac78.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/050c33.wgsl | 3 +- .../gen/textureLoad/050c33.wgsl.expected.hlsl | 9 ++- .../textureLoad/050c33.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/050c33.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/072e26.wgsl | 3 +- .../gen/textureLoad/072e26.wgsl.expected.hlsl | 9 ++- .../textureLoad/072e26.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/072e26.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/078bc4.wgsl | 3 +- .../gen/textureLoad/078bc4.wgsl.expected.hlsl | 9 ++- .../textureLoad/078bc4.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/078bc4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/127e12.wgsl | 3 +- .../gen/textureLoad/127e12.wgsl.expected.hlsl | 9 ++- .../textureLoad/127e12.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/127e12.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/1561a7.wgsl | 3 +- .../gen/textureLoad/1561a7.wgsl.expected.hlsl | 9 ++- .../textureLoad/1561a7.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/1561a7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/19cf87.wgsl | 3 +- .../gen/textureLoad/19cf87.wgsl.expected.hlsl | 9 ++- .../textureLoad/19cf87.wgsl.expected.spvasm | 59 +++++++++------ .../gen/textureLoad/19cf87.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/1a062f.wgsl | 3 +- .../gen/textureLoad/1a062f.wgsl.expected.hlsl | 9 ++- .../textureLoad/1a062f.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/1a062f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/1a8452.wgsl | 3 +- .../gen/textureLoad/1a8452.wgsl.expected.hlsl | 9 ++- .../textureLoad/1a8452.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/1a8452.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/1b8588.wgsl | 3 +- .../gen/textureLoad/1b8588.wgsl.expected.hlsl | 9 ++- .../textureLoad/1b8588.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/1b8588.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/1f2016.wgsl | 3 +- .../gen/textureLoad/1f2016.wgsl.expected.hlsl | 9 ++- .../textureLoad/1f2016.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/1f2016.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/20fa2f.wgsl | 3 +- .../gen/textureLoad/20fa2f.wgsl.expected.hlsl | 9 ++- .../textureLoad/20fa2f.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/20fa2f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/276a2c.wgsl | 3 +- .../gen/textureLoad/276a2c.wgsl.expected.hlsl | 9 ++- .../textureLoad/276a2c.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/276a2c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/2887d7.wgsl | 3 +- .../gen/textureLoad/2887d7.wgsl.expected.hlsl | 9 ++- .../textureLoad/2887d7.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/2887d7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/2ae485.wgsl | 3 +- .../gen/textureLoad/2ae485.wgsl.expected.hlsl | 9 ++- .../textureLoad/2ae485.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/2ae485.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/2d6cf7.wgsl | 3 +- .../gen/textureLoad/2d6cf7.wgsl.expected.hlsl | 9 ++- .../textureLoad/2d6cf7.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/2d6cf7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/3c0d9e.wgsl | 3 +- .../gen/textureLoad/3c0d9e.wgsl.expected.hlsl | 9 ++- .../textureLoad/3c0d9e.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/3c0d9e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/3c9587.wgsl | 3 +- .../gen/textureLoad/3c9587.wgsl.expected.hlsl | 9 ++- .../textureLoad/3c9587.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/3c9587.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/3d001b.wgsl | 3 +- .../gen/textureLoad/3d001b.wgsl.expected.hlsl | 9 ++- .../textureLoad/3d001b.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/3d001b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/3d9c90.wgsl | 3 +- .../gen/textureLoad/3d9c90.wgsl.expected.hlsl | 9 ++- .../textureLoad/3d9c90.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/3d9c90.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/484344.wgsl | 3 +- .../gen/textureLoad/484344.wgsl.expected.hlsl | 9 ++- .../textureLoad/484344.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/484344.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/4fd803.wgsl | 3 +- .../gen/textureLoad/4fd803.wgsl.expected.hlsl | 9 ++- .../textureLoad/4fd803.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/4fd803.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/505aa2.wgsl | 3 +- .../gen/textureLoad/505aa2.wgsl.expected.hlsl | 9 ++- .../textureLoad/505aa2.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/505aa2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/519ab5.wgsl | 3 +- .../gen/textureLoad/519ab5.wgsl.expected.hlsl | 9 ++- .../textureLoad/519ab5.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/519ab5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/53378a.wgsl | 3 +- .../gen/textureLoad/53378a.wgsl.expected.hlsl | 9 ++- .../textureLoad/53378a.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/53378a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/560573.wgsl | 3 +- .../gen/textureLoad/560573.wgsl.expected.hlsl | 9 ++- .../textureLoad/560573.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/560573.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/582015.wgsl | 3 +- .../gen/textureLoad/582015.wgsl.expected.hlsl | 9 ++- .../textureLoad/582015.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/582015.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/5a2f9d.wgsl | 3 +- .../gen/textureLoad/5a2f9d.wgsl.expected.hlsl | 9 ++- .../textureLoad/5a2f9d.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/5a2f9d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/5bb7fb.wgsl | 3 +- .../gen/textureLoad/5bb7fb.wgsl.expected.hlsl | 9 ++- .../textureLoad/5bb7fb.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/5bb7fb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/5d0a2f.wgsl | 3 +- .../gen/textureLoad/5d0a2f.wgsl.expected.hlsl | 9 ++- .../textureLoad/5d0a2f.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/5d0a2f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/6154d4.wgsl | 3 +- .../gen/textureLoad/6154d4.wgsl.expected.hlsl | 9 ++- .../textureLoad/6154d4.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/6154d4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/62d125.wgsl | 3 +- .../gen/textureLoad/62d125.wgsl.expected.hlsl | 9 ++- .../textureLoad/62d125.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/62d125.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/6678b6.wgsl | 3 +- .../gen/textureLoad/6678b6.wgsl.expected.hlsl | 9 ++- .../textureLoad/6678b6.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/6678b6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/67edca.wgsl | 3 +- .../gen/textureLoad/67edca.wgsl.expected.hlsl | 9 ++- .../textureLoad/67edca.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/67edca.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/749704.wgsl | 3 +- .../gen/textureLoad/749704.wgsl.expected.hlsl | 9 ++- .../textureLoad/749704.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/749704.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/79e697.wgsl | 3 +- .../gen/textureLoad/79e697.wgsl.expected.hlsl | 9 ++- .../textureLoad/79e697.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/79e697.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/7c90e5.wgsl | 3 +- .../gen/textureLoad/7c90e5.wgsl.expected.hlsl | 9 ++- .../textureLoad/7c90e5.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/7c90e5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/81c381.wgsl | 3 +- .../gen/textureLoad/81c381.wgsl.expected.hlsl | 9 ++- .../textureLoad/81c381.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/81c381.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/83cea4.wgsl | 3 +- .../gen/textureLoad/83cea4.wgsl.expected.hlsl | 9 ++- .../textureLoad/83cea4.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/83cea4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/87be85.wgsl | 3 +- .../gen/textureLoad/87be85.wgsl.expected.hlsl | 9 ++- .../textureLoad/87be85.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/87be85.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/8acf41.wgsl | 3 +- .../gen/textureLoad/8acf41.wgsl.expected.hlsl | 9 ++- .../textureLoad/8acf41.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/8acf41.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/8e5032.wgsl | 3 +- .../gen/textureLoad/8e5032.wgsl.expected.hlsl | 9 ++- .../textureLoad/8e5032.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/8e5032.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/936952.wgsl | 3 +- .../gen/textureLoad/936952.wgsl.expected.hlsl | 9 ++- .../textureLoad/936952.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/936952.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/9a7c90.wgsl | 3 +- .../gen/textureLoad/9a7c90.wgsl.expected.hlsl | 9 ++- .../textureLoad/9a7c90.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/9a7c90.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/9b2667.wgsl | 3 +- .../gen/textureLoad/9b2667.wgsl.expected.hlsl | 9 ++- .../textureLoad/9b2667.wgsl.expected.spvasm | 59 +++++++++------ .../gen/textureLoad/9b2667.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/9c2a14.wgsl | 3 +- .../gen/textureLoad/9c2a14.wgsl.expected.hlsl | 9 ++- .../textureLoad/9c2a14.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/9c2a14.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/a583c9.wgsl | 3 +- .../gen/textureLoad/a583c9.wgsl.expected.hlsl | 9 ++- .../textureLoad/a583c9.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/a583c9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/a6a85a.wgsl | 3 +- .../gen/textureLoad/a6a85a.wgsl.expected.hlsl | 9 ++- .../textureLoad/a6a85a.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/a6a85a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/a6b61d.wgsl | 3 +- .../gen/textureLoad/a6b61d.wgsl.expected.hlsl | 9 ++- .../textureLoad/a6b61d.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/a6b61d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/a7a3c3.wgsl | 3 +- .../gen/textureLoad/a7a3c3.wgsl.expected.hlsl | 9 ++- .../textureLoad/a7a3c3.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/a7a3c3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/a9a9f5.wgsl | 3 +- .../gen/textureLoad/a9a9f5.wgsl.expected.hlsl | 9 ++- .../textureLoad/a9a9f5.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/a9a9f5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/b1bf79.wgsl | 3 +- .../gen/textureLoad/b1bf79.wgsl.expected.hlsl | 9 ++- .../textureLoad/b1bf79.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/b1bf79.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/b58c6d.wgsl | 3 +- .../gen/textureLoad/b58c6d.wgsl.expected.hlsl | 9 ++- .../textureLoad/b58c6d.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/b58c6d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/b6c458.wgsl | 3 +- .../gen/textureLoad/b6c458.wgsl.expected.hlsl | 9 ++- .../textureLoad/b6c458.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/b6c458.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/bfd154.wgsl | 3 +- .../gen/textureLoad/bfd154.wgsl.expected.hlsl | 9 ++- .../textureLoad/bfd154.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/bfd154.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c02b74.wgsl | 3 +- .../gen/textureLoad/c02b74.wgsl.expected.hlsl | 9 ++- .../textureLoad/c02b74.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/c02b74.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c07013.wgsl | 3 +- .../gen/textureLoad/c07013.wgsl.expected.hlsl | 9 ++- .../textureLoad/c07013.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/c07013.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c2a480.wgsl | 3 +- .../gen/textureLoad/c2a480.wgsl.expected.hlsl | 9 ++- .../textureLoad/c2a480.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/c2a480.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c378ee.wgsl | 3 +- .../gen/textureLoad/c378ee.wgsl.expected.hlsl | 9 ++- .../textureLoad/c378ee.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/c378ee.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c40dcb.wgsl | 3 +- .../gen/textureLoad/c40dcb.wgsl.expected.hlsl | 9 ++- .../textureLoad/c40dcb.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/c40dcb.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c456bc.wgsl | 3 +- .../gen/textureLoad/c456bc.wgsl.expected.hlsl | 9 ++- .../textureLoad/c456bc.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/c456bc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c7cbed.wgsl | 3 +- .../gen/textureLoad/c7cbed.wgsl.expected.hlsl | 9 ++- .../textureLoad/c7cbed.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/c7cbed.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/c9cc40.wgsl | 3 +- .../gen/textureLoad/c9cc40.wgsl.expected.hlsl | 9 ++- .../textureLoad/c9cc40.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/c9cc40.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/d5c48d.wgsl | 3 +- .../gen/textureLoad/d5c48d.wgsl.expected.hlsl | 9 ++- .../textureLoad/d5c48d.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/d5c48d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/d81c57.wgsl | 3 +- .../gen/textureLoad/d81c57.wgsl.expected.hlsl | 9 ++- .../textureLoad/d81c57.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/d81c57.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/d8617f.wgsl | 3 +- .../gen/textureLoad/d8617f.wgsl.expected.hlsl | 9 ++- .../textureLoad/d8617f.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/d8617f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/dbd554.wgsl | 3 +- .../gen/textureLoad/dbd554.wgsl.expected.hlsl | 9 ++- .../textureLoad/dbd554.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/dbd554.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/ddeed3.wgsl | 3 +- .../gen/textureLoad/ddeed3.wgsl.expected.hlsl | 9 ++- .../textureLoad/ddeed3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/ddeed3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/dee8e7.wgsl | 3 +- .../gen/textureLoad/dee8e7.wgsl.expected.hlsl | 9 ++- .../textureLoad/dee8e7.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/dee8e7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/e3d2cc.wgsl | 3 +- .../gen/textureLoad/e3d2cc.wgsl.expected.hlsl | 9 ++- .../textureLoad/e3d2cc.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/e3d2cc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/e65916.wgsl | 3 +- .../gen/textureLoad/e65916.wgsl.expected.hlsl | 9 ++- .../textureLoad/e65916.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/e65916.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/e893d7.wgsl | 3 +- .../gen/textureLoad/e893d7.wgsl.expected.hlsl | 9 ++- .../textureLoad/e893d7.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/e893d7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/eb573b.wgsl | 3 +- .../gen/textureLoad/eb573b.wgsl.expected.hlsl | 9 ++- .../textureLoad/eb573b.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/eb573b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/ecc823.wgsl | 3 +- .../gen/textureLoad/ecc823.wgsl.expected.hlsl | 9 ++- .../textureLoad/ecc823.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/ecc823.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/ef5405.wgsl | 3 +- .../gen/textureLoad/ef5405.wgsl.expected.hlsl | 9 ++- .../textureLoad/ef5405.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/ef5405.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/f06b69.wgsl | 3 +- .../gen/textureLoad/f06b69.wgsl.expected.hlsl | 9 ++- .../textureLoad/f06b69.wgsl.expected.spvasm | 54 +++++++++----- .../gen/textureLoad/f06b69.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/f379e2.wgsl | 3 +- .../gen/textureLoad/f379e2.wgsl.expected.hlsl | 9 ++- .../textureLoad/f379e2.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/f379e2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/f56e6f.wgsl | 3 +- .../gen/textureLoad/f56e6f.wgsl.expected.hlsl | 9 ++- .../textureLoad/f56e6f.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/f56e6f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/f74bd8.wgsl | 3 +- .../gen/textureLoad/f74bd8.wgsl.expected.hlsl | 9 ++- .../textureLoad/f74bd8.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/f74bd8.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/fc6d36.wgsl | 3 +- .../gen/textureLoad/fc6d36.wgsl.expected.hlsl | 9 ++- .../textureLoad/fc6d36.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/fc6d36.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/fdebd0.wgsl | 3 +- .../gen/textureLoad/fdebd0.wgsl.expected.hlsl | 9 ++- .../textureLoad/fdebd0.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/fdebd0.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/fe222a.wgsl | 3 +- .../gen/textureLoad/fe222a.wgsl.expected.hlsl | 9 ++- .../textureLoad/fe222a.wgsl.expected.spvasm | 56 +++++++++------ .../gen/textureLoad/fe222a.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureLoad/feab99.wgsl | 3 +- .../gen/textureLoad/feab99.wgsl.expected.hlsl | 9 ++- .../textureLoad/feab99.wgsl.expected.spvasm | 58 +++++++++------ .../gen/textureLoad/feab99.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/024820.wgsl | 3 +- .../024820.wgsl.expected.hlsl | 9 ++- .../024820.wgsl.expected.spvasm | 56 +++++++++------ .../024820.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/053df7.wgsl | 3 +- .../053df7.wgsl.expected.hlsl | 9 ++- .../053df7.wgsl.expected.spvasm | 56 +++++++++------ .../053df7.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/058cc3.wgsl | 3 +- .../058cc3.wgsl.expected.hlsl | 9 ++- .../058cc3.wgsl.expected.spvasm | 56 +++++++++------ .../058cc3.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/09d05d.wgsl | 3 +- .../09d05d.wgsl.expected.hlsl | 9 ++- .../09d05d.wgsl.expected.spvasm | 56 +++++++++------ .../09d05d.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/13b4ce.wgsl | 3 +- .../13b4ce.wgsl.expected.hlsl | 9 ++- .../13b4ce.wgsl.expected.spvasm | 56 +++++++++------ .../13b4ce.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/22e53b.wgsl | 3 +- .../22e53b.wgsl.expected.hlsl | 9 ++- .../22e53b.wgsl.expected.spvasm | 56 +++++++++------ .../22e53b.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/2f6bb3.wgsl | 3 +- .../2f6bb3.wgsl.expected.hlsl | 9 ++- .../2f6bb3.wgsl.expected.spvasm | 56 +++++++++------ .../2f6bb3.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/315298.wgsl | 3 +- .../315298.wgsl.expected.hlsl | 9 ++- .../315298.wgsl.expected.spvasm | 56 +++++++++------ .../315298.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/3615e3.wgsl | 3 +- .../3615e3.wgsl.expected.hlsl | 9 ++- .../3615e3.wgsl.expected.spvasm | 56 +++++++++------ .../3615e3.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/390fd5.wgsl | 3 +- .../390fd5.wgsl.expected.hlsl | 9 ++- .../390fd5.wgsl.expected.spvasm | 56 +++++++++------ .../390fd5.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/45155d.wgsl | 3 +- .../45155d.wgsl.expected.hlsl | 9 ++- .../45155d.wgsl.expected.spvasm | 56 +++++++++------ .../45155d.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/4bf67b.wgsl | 3 +- .../4bf67b.wgsl.expected.hlsl | 9 ++- .../4bf67b.wgsl.expected.spvasm | 56 +++++++++------ .../4bf67b.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/562013.wgsl | 3 +- .../562013.wgsl.expected.hlsl | 9 ++- .../562013.wgsl.expected.spvasm | 56 +++++++++------ .../562013.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/57092f.wgsl | 3 +- .../57092f.wgsl.expected.hlsl | 9 ++- .../57092f.wgsl.expected.spvasm | 56 +++++++++------ .../57092f.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/5d59cd.wgsl | 3 +- .../5d59cd.wgsl.expected.hlsl | 9 ++- .../5d59cd.wgsl.expected.spvasm | 56 +++++++++------ .../5d59cd.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/68a65b.wgsl | 3 +- .../68a65b.wgsl.expected.hlsl | 9 ++- .../68a65b.wgsl.expected.spvasm | 56 +++++++++------ .../68a65b.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/778bd1.wgsl | 3 +- .../778bd1.wgsl.expected.hlsl | 9 ++- .../778bd1.wgsl.expected.spvasm | 56 +++++++++------ .../778bd1.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/7f1937.wgsl | 3 +- .../7f1937.wgsl.expected.hlsl | 9 ++- .../7f1937.wgsl.expected.spvasm | 56 +++++++++------ .../7f1937.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/85f980.wgsl | 3 +- .../85f980.wgsl.expected.hlsl | 9 ++- .../85f980.wgsl.expected.spvasm | 56 +++++++++------ .../85f980.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/87953e.wgsl | 3 +- .../87953e.wgsl.expected.hlsl | 9 ++- .../87953e.wgsl.expected.spvasm | 56 +++++++++------ .../87953e.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/893e7c.wgsl | 3 +- .../893e7c.wgsl.expected.hlsl | 9 ++- .../893e7c.wgsl.expected.spvasm | 56 +++++++++------ .../893e7c.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/938763.wgsl | 3 +- .../938763.wgsl.expected.hlsl | 9 ++- .../938763.wgsl.expected.spvasm | 56 +++++++++------ .../938763.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/9700fb.wgsl | 3 +- .../9700fb.wgsl.expected.hlsl | 9 ++- .../9700fb.wgsl.expected.spvasm | 56 +++++++++------ .../9700fb.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/a216d2.wgsl | 3 +- .../a216d2.wgsl.expected.hlsl | 9 ++- .../a216d2.wgsl.expected.spvasm | 56 +++++++++------ .../a216d2.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/aa08a7.wgsl | 3 +- .../aa08a7.wgsl.expected.hlsl | 9 ++- .../aa08a7.wgsl.expected.spvasm | 56 +++++++++------ .../aa08a7.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/ab0c9b.wgsl | 3 +- .../ab0c9b.wgsl.expected.hlsl | 9 ++- .../ab0c9b.wgsl.expected.spvasm | 56 +++++++++------ .../ab0c9b.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/b8cd76.wgsl | 3 +- .../b8cd76.wgsl.expected.hlsl | 9 ++- .../b8cd76.wgsl.expected.spvasm | 56 +++++++++------ .../b8cd76.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/be1d70.wgsl | 3 +- .../be1d70.wgsl.expected.hlsl | 9 ++- .../be1d70.wgsl.expected.spvasm | 56 +++++++++------ .../be1d70.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/be3acb.wgsl | 3 +- .../be3acb.wgsl.expected.hlsl | 9 ++- .../be3acb.wgsl.expected.spvasm | 56 +++++++++------ .../be3acb.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/c09917.wgsl | 3 +- .../c09917.wgsl.expected.hlsl | 9 ++- .../c09917.wgsl.expected.spvasm | 56 +++++++++------ .../c09917.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/c7c7f2.wgsl | 3 +- .../c7c7f2.wgsl.expected.hlsl | 9 ++- .../c7c7f2.wgsl.expected.spvasm | 56 +++++++++------ .../c7c7f2.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/cd5dc8.wgsl | 3 +- .../cd5dc8.wgsl.expected.hlsl | 9 ++- .../cd5dc8.wgsl.expected.spvasm | 56 +++++++++------ .../cd5dc8.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/d5b228.wgsl | 3 +- .../d5b228.wgsl.expected.hlsl | 9 ++- .../d5b228.wgsl.expected.spvasm | 56 +++++++++------ .../d5b228.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/e15642.wgsl | 3 +- .../e15642.wgsl.expected.hlsl | 9 ++- .../e15642.wgsl.expected.spvasm | 56 +++++++++------ .../e15642.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/e31be1.wgsl | 3 +- .../e31be1.wgsl.expected.hlsl | 9 ++- .../e31be1.wgsl.expected.spvasm | 56 +++++++++------ .../e31be1.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/e653c0.wgsl | 3 +- .../e653c0.wgsl.expected.hlsl | 9 ++- .../e653c0.wgsl.expected.spvasm | 56 +++++++++------ .../e653c0.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/ee942f.wgsl | 3 +- .../ee942f.wgsl.expected.hlsl | 9 ++- .../ee942f.wgsl.expected.spvasm | 56 +++++++++------ .../ee942f.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/f33005.wgsl | 3 +- .../f33005.wgsl.expected.hlsl | 9 ++- .../f33005.wgsl.expected.spvasm | 56 +++++++++------ .../f33005.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/fcec98.wgsl | 3 +- .../fcec98.wgsl.expected.hlsl | 9 ++- .../fcec98.wgsl.expected.spvasm | 56 +++++++++------ .../fcec98.wgsl.expected.wgsl | 3 +- .../gen/textureNumLayers/ff5e89.wgsl | 3 +- .../ff5e89.wgsl.expected.hlsl | 9 ++- .../ff5e89.wgsl.expected.spvasm | 56 +++++++++------ .../ff5e89.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/076cb5.wgsl | 3 +- .../076cb5.wgsl.expected.hlsl | 9 ++- .../076cb5.wgsl.expected.spvasm | 54 +++++++++----- .../076cb5.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/080d95.wgsl | 3 +- .../080d95.wgsl.expected.hlsl | 9 ++- .../080d95.wgsl.expected.spvasm | 54 +++++++++----- .../080d95.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/09ddd0.wgsl | 3 +- .../09ddd0.wgsl.expected.hlsl | 9 ++- .../09ddd0.wgsl.expected.spvasm | 54 +++++++++----- .../09ddd0.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/105988.wgsl | 3 +- .../105988.wgsl.expected.hlsl | 9 ++- .../105988.wgsl.expected.spvasm | 54 +++++++++----- .../105988.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/23f750.wgsl | 3 +- .../23f750.wgsl.expected.hlsl | 9 ++- .../23f750.wgsl.expected.spvasm | 54 +++++++++----- .../23f750.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/2c3575.wgsl | 3 +- .../2c3575.wgsl.expected.hlsl | 9 ++- .../2c3575.wgsl.expected.spvasm | 54 +++++++++----- .../2c3575.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/5101cf.wgsl | 3 +- .../5101cf.wgsl.expected.hlsl | 9 ++- .../5101cf.wgsl.expected.spvasm | 54 +++++++++----- .../5101cf.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/897aaf.wgsl | 3 +- .../897aaf.wgsl.expected.hlsl | 9 ++- .../897aaf.wgsl.expected.spvasm | 54 +++++++++----- .../897aaf.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/9da7a5.wgsl | 3 +- .../9da7a5.wgsl.expected.hlsl | 9 ++- .../9da7a5.wgsl.expected.spvasm | 54 +++++++++----- .../9da7a5.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/a91c03.wgsl | 3 +- .../a91c03.wgsl.expected.hlsl | 9 ++- .../a91c03.wgsl.expected.spvasm | 54 +++++++++----- .../a91c03.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/aee7c8.wgsl | 3 +- .../aee7c8.wgsl.expected.hlsl | 9 ++- .../aee7c8.wgsl.expected.spvasm | 54 +++++++++----- .../aee7c8.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/b1b12b.wgsl | 3 +- .../b1b12b.wgsl.expected.hlsl | 9 ++- .../b1b12b.wgsl.expected.spvasm | 54 +++++++++----- .../b1b12b.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/b4f5ea.wgsl | 3 +- .../b4f5ea.wgsl.expected.hlsl | 9 ++- .../b4f5ea.wgsl.expected.spvasm | 54 +++++++++----- .../b4f5ea.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/d004a9.wgsl | 3 +- .../d004a9.wgsl.expected.hlsl | 9 ++- .../d004a9.wgsl.expected.spvasm | 54 +++++++++----- .../d004a9.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/dca09e.wgsl | 3 +- .../dca09e.wgsl.expected.hlsl | 9 ++- .../dca09e.wgsl.expected.spvasm | 54 +++++++++----- .../dca09e.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/e67231.wgsl | 3 +- .../e67231.wgsl.expected.hlsl | 9 ++- .../e67231.wgsl.expected.spvasm | 54 +++++++++----- .../e67231.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/ed078b.wgsl | 3 +- .../ed078b.wgsl.expected.hlsl | 9 ++- .../ed078b.wgsl.expected.spvasm | 54 +++++++++----- .../ed078b.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/f46ec6.wgsl | 3 +- .../f46ec6.wgsl.expected.hlsl | 9 ++- .../f46ec6.wgsl.expected.spvasm | 54 +++++++++----- .../f46ec6.wgsl.expected.wgsl | 3 +- .../gen/textureNumLevels/f5828d.wgsl | 3 +- .../f5828d.wgsl.expected.hlsl | 9 ++- .../f5828d.wgsl.expected.spvasm | 54 +++++++++----- .../f5828d.wgsl.expected.wgsl | 3 +- .../gen/textureNumSamples/2c6f14.wgsl | 3 +- .../2c6f14.wgsl.expected.hlsl | 9 ++- .../2c6f14.wgsl.expected.spvasm | 54 +++++++++----- .../2c6f14.wgsl.expected.wgsl | 3 +- .../gen/textureNumSamples/42f8bb.wgsl | 3 +- .../42f8bb.wgsl.expected.hlsl | 9 ++- .../42f8bb.wgsl.expected.spvasm | 54 +++++++++----- .../42f8bb.wgsl.expected.wgsl | 3 +- .../gen/textureNumSamples/449d23.wgsl | 3 +- .../449d23.wgsl.expected.hlsl | 9 ++- .../449d23.wgsl.expected.spvasm | 54 +++++++++----- .../449d23.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/21402b.wgsl | 3 +- .../21402b.wgsl.expected.hlsl | 9 ++- .../21402b.wgsl.expected.spvasm | 64 ++++++++++------- .../21402b.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/2ecd8f.wgsl | 3 +- .../2ecd8f.wgsl.expected.hlsl | 9 ++- .../2ecd8f.wgsl.expected.spvasm | 68 +++++++++++------- .../2ecd8f.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/468f88.wgsl | 3 +- .../468f88.wgsl.expected.hlsl | 9 ++- .../468f88.wgsl.expected.spvasm | 66 ++++++++++------- .../468f88.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/521263.wgsl | 3 +- .../521263.wgsl.expected.hlsl | 9 ++- .../521263.wgsl.expected.spvasm | 64 ++++++++++------- .../521263.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/5312f4.wgsl | 3 +- .../5312f4.wgsl.expected.hlsl | 9 ++- .../5312f4.wgsl.expected.spvasm | 64 ++++++++++------- .../5312f4.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/872f00.wgsl | 3 +- .../872f00.wgsl.expected.hlsl | 9 ++- .../872f00.wgsl.expected.spvasm | 70 ++++++++++-------- .../872f00.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/e383db.wgsl | 3 +- .../e383db.wgsl.expected.hlsl | 9 ++- .../e383db.wgsl.expected.spvasm | 68 +++++++++++------- .../e383db.wgsl.expected.wgsl | 3 +- .../gen/textureSampleGrad/e9a2f7.wgsl | 3 +- .../e9a2f7.wgsl.expected.hlsl | 9 ++- .../e9a2f7.wgsl.expected.spvasm | 66 ++++++++++------- .../e9a2f7.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/02be59.wgsl | 3 +- .../02be59.wgsl.expected.hlsl | 9 ++- .../02be59.wgsl.expected.spvasm | 67 ++++++++++------- .../02be59.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/0bdd9a.wgsl | 3 +- .../0bdd9a.wgsl.expected.hlsl | 9 ++- .../0bdd9a.wgsl.expected.spvasm | 66 ++++++++++------- .../0bdd9a.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/1b0291.wgsl | 3 +- .../1b0291.wgsl.expected.hlsl | 9 ++- .../1b0291.wgsl.expected.spvasm | 67 ++++++++++------- .../1b0291.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/1bf73e.wgsl | 3 +- .../1bf73e.wgsl.expected.hlsl | 9 ++- .../1bf73e.wgsl.expected.spvasm | 69 +++++++++++------- .../1bf73e.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/302be4.wgsl | 3 +- .../302be4.wgsl.expected.hlsl | 9 ++- .../302be4.wgsl.expected.spvasm | 66 ++++++++++------- .../302be4.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/47daa4.wgsl | 3 +- .../47daa4.wgsl.expected.hlsl | 9 ++- .../47daa4.wgsl.expected.spvasm | 69 +++++++++++------- .../47daa4.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/690d95.wgsl | 3 +- .../690d95.wgsl.expected.hlsl | 9 ++- .../690d95.wgsl.expected.spvasm | 66 ++++++++++------- .../690d95.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/979816.wgsl | 3 +- .../979816.wgsl.expected.hlsl | 9 ++- .../979816.wgsl.expected.spvasm | 64 ++++++++++------- .../979816.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/9bd37b.wgsl | 3 +- .../9bd37b.wgsl.expected.hlsl | 9 ++- .../9bd37b.wgsl.expected.spvasm | 66 ++++++++++------- .../9bd37b.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/a4af26.wgsl | 3 +- .../a4af26.wgsl.expected.hlsl | 9 ++- .../a4af26.wgsl.expected.spvasm | 68 +++++++++++------- .../a4af26.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/abfcc0.wgsl | 3 +- .../abfcc0.wgsl.expected.hlsl | 9 ++- .../abfcc0.wgsl.expected.spvasm | 64 ++++++++++------- .../abfcc0.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/ae5e39.wgsl | 3 +- .../ae5e39.wgsl.expected.hlsl | 9 ++- .../ae5e39.wgsl.expected.spvasm | 69 +++++++++++------- .../ae5e39.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/ba93b3.wgsl | 3 +- .../ba93b3.wgsl.expected.hlsl | 9 ++- .../ba93b3.wgsl.expected.spvasm | 71 +++++++++++-------- .../ba93b3.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/c32df7.wgsl | 3 +- .../c32df7.wgsl.expected.hlsl | 9 ++- .../c32df7.wgsl.expected.spvasm | 64 ++++++++++------- .../c32df7.wgsl.expected.wgsl | 3 +- .../gen/textureSampleLevel/c6aca6.wgsl | 3 +- .../c6aca6.wgsl.expected.hlsl | 9 ++- .../c6aca6.wgsl.expected.spvasm | 64 ++++++++++------- .../c6aca6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/05ce15.wgsl | 3 +- .../textureStore/05ce15.wgsl.expected.hlsl | 9 ++- .../textureStore/05ce15.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/05ce15.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/064c7f.wgsl | 3 +- .../textureStore/064c7f.wgsl.expected.hlsl | 9 ++- .../textureStore/064c7f.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/064c7f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/068641.wgsl | 3 +- .../textureStore/068641.wgsl.expected.hlsl | 9 ++- .../textureStore/068641.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/068641.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/0af6b5.wgsl | 3 +- .../textureStore/0af6b5.wgsl.expected.hlsl | 9 ++- .../textureStore/0af6b5.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/0af6b5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/0c3dff.wgsl | 3 +- .../textureStore/0c3dff.wgsl.expected.hlsl | 9 ++- .../textureStore/0c3dff.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/0c3dff.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/102722.wgsl | 3 +- .../textureStore/102722.wgsl.expected.hlsl | 9 ++- .../textureStore/102722.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/102722.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/1bbd08.wgsl | 3 +- .../textureStore/1bbd08.wgsl.expected.hlsl | 9 ++- .../textureStore/1bbd08.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/1bbd08.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/1c02e7.wgsl | 3 +- .../textureStore/1c02e7.wgsl.expected.hlsl | 9 ++- .../textureStore/1c02e7.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/1c02e7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/22d955.wgsl | 3 +- .../textureStore/22d955.wgsl.expected.hlsl | 9 ++- .../textureStore/22d955.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/22d955.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/26bf70.wgsl | 3 +- .../textureStore/26bf70.wgsl.expected.hlsl | 9 ++- .../textureStore/26bf70.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/26bf70.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/2796b4.wgsl | 3 +- .../textureStore/2796b4.wgsl.expected.hlsl | 9 ++- .../textureStore/2796b4.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/2796b4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/2ac6c7.wgsl | 3 +- .../textureStore/2ac6c7.wgsl.expected.hlsl | 9 ++- .../textureStore/2ac6c7.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/2ac6c7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/2eb2a4.wgsl | 3 +- .../textureStore/2eb2a4.wgsl.expected.hlsl | 9 ++- .../textureStore/2eb2a4.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/2eb2a4.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/2ed2a3.wgsl | 3 +- .../textureStore/2ed2a3.wgsl.expected.hlsl | 9 ++- .../textureStore/2ed2a3.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/2ed2a3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/31745b.wgsl | 3 +- .../textureStore/31745b.wgsl.expected.hlsl | 9 ++- .../textureStore/31745b.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/31745b.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/32f368.wgsl | 3 +- .../textureStore/32f368.wgsl.expected.hlsl | 9 ++- .../textureStore/32f368.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/32f368.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/331aee.wgsl | 3 +- .../textureStore/331aee.wgsl.expected.hlsl | 9 ++- .../textureStore/331aee.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/331aee.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/38e8d7.wgsl | 3 +- .../textureStore/38e8d7.wgsl.expected.hlsl | 9 ++- .../textureStore/38e8d7.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/38e8d7.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/3a52ac.wgsl | 3 +- .../textureStore/3a52ac.wgsl.expected.hlsl | 9 ++- .../textureStore/3a52ac.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/3a52ac.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/3bb7a1.wgsl | 3 +- .../textureStore/3bb7a1.wgsl.expected.hlsl | 9 ++- .../textureStore/3bb7a1.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/3bb7a1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/3bec15.wgsl | 3 +- .../textureStore/3bec15.wgsl.expected.hlsl | 9 ++- .../textureStore/3bec15.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/3bec15.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/441ba8.wgsl | 3 +- .../textureStore/441ba8.wgsl.expected.hlsl | 9 ++- .../textureStore/441ba8.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/441ba8.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/4fc057.wgsl | 3 +- .../textureStore/4fc057.wgsl.expected.hlsl | 9 ++- .../textureStore/4fc057.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/4fc057.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/5a2f8f.wgsl | 3 +- .../textureStore/5a2f8f.wgsl.expected.hlsl | 9 ++- .../textureStore/5a2f8f.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/5a2f8f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/60975f.wgsl | 3 +- .../textureStore/60975f.wgsl.expected.hlsl | 9 ++- .../textureStore/60975f.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/60975f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/682fd6.wgsl | 3 +- .../textureStore/682fd6.wgsl.expected.hlsl | 9 ++- .../textureStore/682fd6.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/682fd6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/6b75c3.wgsl | 3 +- .../textureStore/6b75c3.wgsl.expected.hlsl | 9 ++- .../textureStore/6b75c3.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/6b75c3.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/6b80d2.wgsl | 3 +- .../textureStore/6b80d2.wgsl.expected.hlsl | 9 ++- .../textureStore/6b80d2.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/6b80d2.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/6cff2e.wgsl | 3 +- .../textureStore/6cff2e.wgsl.expected.hlsl | 9 ++- .../textureStore/6cff2e.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/6cff2e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/6da692.wgsl | 3 +- .../textureStore/6da692.wgsl.expected.hlsl | 9 ++- .../textureStore/6da692.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/6da692.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/731349.wgsl | 3 +- .../textureStore/731349.wgsl.expected.hlsl | 9 ++- .../textureStore/731349.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/731349.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/752da6.wgsl | 3 +- .../textureStore/752da6.wgsl.expected.hlsl | 9 ++- .../textureStore/752da6.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/752da6.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/77c0ae.wgsl | 3 +- .../textureStore/77c0ae.wgsl.expected.hlsl | 9 ++- .../textureStore/77c0ae.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/77c0ae.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/7cec8d.wgsl | 3 +- .../textureStore/7cec8d.wgsl.expected.hlsl | 9 ++- .../textureStore/7cec8d.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/7cec8d.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/7f7fae.wgsl | 3 +- .../textureStore/7f7fae.wgsl.expected.hlsl | 9 ++- .../textureStore/7f7fae.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/7f7fae.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/804942.wgsl | 3 +- .../textureStore/804942.wgsl.expected.hlsl | 9 ++- .../textureStore/804942.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/804942.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/805dae.wgsl | 3 +- .../textureStore/805dae.wgsl.expected.hlsl | 9 ++- .../textureStore/805dae.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/805dae.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/83bcc1.wgsl | 3 +- .../textureStore/83bcc1.wgsl.expected.hlsl | 9 ++- .../textureStore/83bcc1.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/83bcc1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/872747.wgsl | 3 +- .../textureStore/872747.wgsl.expected.hlsl | 9 ++- .../textureStore/872747.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/872747.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/8e0479.wgsl | 3 +- .../textureStore/8e0479.wgsl.expected.hlsl | 9 ++- .../textureStore/8e0479.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/8e0479.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/8f71a1.wgsl | 3 +- .../textureStore/8f71a1.wgsl.expected.hlsl | 9 ++- .../textureStore/8f71a1.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/8f71a1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/969534.wgsl | 3 +- .../textureStore/969534.wgsl.expected.hlsl | 9 ++- .../textureStore/969534.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/969534.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/9a3ecc.wgsl | 3 +- .../textureStore/9a3ecc.wgsl.expected.hlsl | 9 ++- .../textureStore/9a3ecc.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/9a3ecc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/9d9cd5.wgsl | 3 +- .../textureStore/9d9cd5.wgsl.expected.hlsl | 9 ++- .../textureStore/9d9cd5.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/9d9cd5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/9e3ec5.wgsl | 3 +- .../textureStore/9e3ec5.wgsl.expected.hlsl | 9 ++- .../textureStore/9e3ec5.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/9e3ec5.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/ac67aa.wgsl | 3 +- .../textureStore/ac67aa.wgsl.expected.hlsl | 9 ++- .../textureStore/ac67aa.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/ac67aa.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/b706b1.wgsl | 3 +- .../textureStore/b706b1.wgsl.expected.hlsl | 9 ++- .../textureStore/b706b1.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/b706b1.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/bbcb7f.wgsl | 3 +- .../textureStore/bbcb7f.wgsl.expected.hlsl | 9 ++- .../textureStore/bbcb7f.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/bbcb7f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/be6e30.wgsl | 3 +- .../textureStore/be6e30.wgsl.expected.hlsl | 9 ++- .../textureStore/be6e30.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/be6e30.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/bf775c.wgsl | 3 +- .../textureStore/bf775c.wgsl.expected.hlsl | 9 ++- .../textureStore/bf775c.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/bf775c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/c5af1e.wgsl | 3 +- .../textureStore/c5af1e.wgsl.expected.hlsl | 9 ++- .../textureStore/c5af1e.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/c5af1e.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/c863be.wgsl | 3 +- .../textureStore/c863be.wgsl.expected.hlsl | 9 ++- .../textureStore/c863be.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/c863be.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/d73b5c.wgsl | 3 +- .../textureStore/d73b5c.wgsl.expected.hlsl | 9 ++- .../textureStore/d73b5c.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/d73b5c.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/dd7d81.wgsl | 3 +- .../textureStore/dd7d81.wgsl.expected.hlsl | 9 ++- .../textureStore/dd7d81.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/dd7d81.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/dde364.wgsl | 3 +- .../textureStore/dde364.wgsl.expected.hlsl | 9 ++- .../textureStore/dde364.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/dde364.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/e885e8.wgsl | 3 +- .../textureStore/e885e8.wgsl.expected.hlsl | 9 ++- .../textureStore/e885e8.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/e885e8.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/eb702f.wgsl | 3 +- .../textureStore/eb702f.wgsl.expected.hlsl | 9 ++- .../textureStore/eb702f.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/eb702f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/eb78b9.wgsl | 3 +- .../textureStore/eb78b9.wgsl.expected.hlsl | 9 ++- .../textureStore/eb78b9.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/eb78b9.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/ee6acc.wgsl | 3 +- .../textureStore/ee6acc.wgsl.expected.hlsl | 9 ++- .../textureStore/ee6acc.wgsl.expected.spvasm | 54 ++++++++------ .../textureStore/ee6acc.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/ef9f2f.wgsl | 3 +- .../textureStore/ef9f2f.wgsl.expected.hlsl | 9 ++- .../textureStore/ef9f2f.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/ef9f2f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/f8dead.wgsl | 3 +- .../textureStore/f8dead.wgsl.expected.hlsl | 9 ++- .../textureStore/f8dead.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/f8dead.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/f9be83.wgsl | 3 +- .../textureStore/f9be83.wgsl.expected.hlsl | 9 ++- .../textureStore/f9be83.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/f9be83.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/fb9a8f.wgsl | 3 +- .../textureStore/fb9a8f.wgsl.expected.hlsl | 9 ++- .../textureStore/fb9a8f.wgsl.expected.spvasm | 50 ++++++++----- .../textureStore/fb9a8f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/textureStore/fbf53f.wgsl | 3 +- .../textureStore/fbf53f.wgsl.expected.hlsl | 9 ++- .../textureStore/fbf53f.wgsl.expected.spvasm | 52 +++++++++----- .../textureStore/fbf53f.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/trunc/562d05.wgsl | 3 +- .../gen/trunc/562d05.wgsl.expected.hlsl | 9 ++- .../gen/trunc/562d05.wgsl.expected.msl | 9 ++- .../gen/trunc/562d05.wgsl.expected.spvasm | 54 +++++++++----- .../gen/trunc/562d05.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/trunc/e183aa.wgsl | 3 +- .../gen/trunc/e183aa.wgsl.expected.hlsl | 9 ++- .../gen/trunc/e183aa.wgsl.expected.msl | 9 ++- .../gen/trunc/e183aa.wgsl.expected.spvasm | 56 +++++++++------ .../gen/trunc/e183aa.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/trunc/eb83df.wgsl | 3 +- .../gen/trunc/eb83df.wgsl.expected.hlsl | 9 ++- .../gen/trunc/eb83df.wgsl.expected.msl | 9 ++- .../gen/trunc/eb83df.wgsl.expected.spvasm | 58 +++++++++------ .../gen/trunc/eb83df.wgsl.expected.wgsl | 3 +- test/intrinsics/gen/trunc/f370d3.wgsl | 3 +- .../gen/trunc/f370d3.wgsl.expected.hlsl | 9 ++- .../gen/trunc/f370d3.wgsl.expected.msl | 9 ++- .../gen/trunc/f370d3.wgsl.expected.spvasm | 54 +++++++++----- .../gen/trunc/f370d3.wgsl.expected.wgsl | 3 +- .../gen/unpack2x16float/32a5cf.wgsl | 3 +- .../unpack2x16float/32a5cf.wgsl.expected.hlsl | 9 ++- .../unpack2x16float/32a5cf.wgsl.expected.msl | 9 ++- .../32a5cf.wgsl.expected.spvasm | 54 +++++++++----- .../unpack2x16float/32a5cf.wgsl.expected.wgsl | 3 +- .../gen/unpack2x16snorm/b4aea6.wgsl | 3 +- .../unpack2x16snorm/b4aea6.wgsl.expected.hlsl | 9 ++- .../unpack2x16snorm/b4aea6.wgsl.expected.msl | 9 ++- .../b4aea6.wgsl.expected.spvasm | 54 +++++++++----- .../unpack2x16snorm/b4aea6.wgsl.expected.wgsl | 3 +- .../gen/unpack2x16unorm/7699c0.wgsl | 3 +- .../unpack2x16unorm/7699c0.wgsl.expected.hlsl | 9 ++- .../unpack2x16unorm/7699c0.wgsl.expected.msl | 9 ++- .../7699c0.wgsl.expected.spvasm | 54 +++++++++----- .../unpack2x16unorm/7699c0.wgsl.expected.wgsl | 3 +- .../intrinsics/gen/unpack4x8snorm/523fb3.wgsl | 3 +- .../unpack4x8snorm/523fb3.wgsl.expected.hlsl | 9 ++- .../unpack4x8snorm/523fb3.wgsl.expected.msl | 9 ++- .../523fb3.wgsl.expected.spvasm | 56 +++++++++------ .../unpack4x8snorm/523fb3.wgsl.expected.wgsl | 3 +- .../intrinsics/gen/unpack4x8unorm/750c74.wgsl | 3 +- .../unpack4x8unorm/750c74.wgsl.expected.hlsl | 9 ++- .../unpack4x8unorm/750c74.wgsl.expected.msl | 9 ++- .../750c74.wgsl.expected.spvasm | 56 +++++++++------ .../unpack4x8unorm/750c74.wgsl.expected.wgsl | 3 +- test/intrinsics/intrinsics.wgsl.tmpl | 3 +- tools/check-spec-examples/main.go | 2 +- 2923 files changed, 32447 insertions(+), 16304 deletions(-) diff --git a/test/intrinsics/gen/abs/002533.wgsl b/test/intrinsics/gen/abs/002533.wgsl index 26a968f86e..bc77230307 100644 --- a/test/intrinsics/gen/abs/002533.wgsl +++ b/test/intrinsics/gen/abs/002533.wgsl @@ -27,8 +27,9 @@ fn abs_002533() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_002533(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl index 63a8d671ea..8f4024ee39 100644 --- a/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_002533() { float4 res = abs(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { abs_002533(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.msl b/test/intrinsics/gen/abs/002533.wgsl.expected.msl index 15940e87b8..1258a267d9 100644 --- a/test/intrinsics/gen/abs/002533.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_002533() { float4 res = fabs(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_002533(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm index 90cbf83ea4..1c8872fcca 100644 --- a/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_002533 "abs_002533" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_002533 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 FAbs %12 - OpStore %res %9 + %abs_002533 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 FAbs %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %abs_002533 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %abs_002533 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %abs_002533 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %abs_002533 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_002533 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl index 480a9de6cb..60b2b6ca3a 100644 --- a/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_002533() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_002533(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/005174.wgsl b/test/intrinsics/gen/abs/005174.wgsl index 7384a15183..a9b136aa90 100644 --- a/test/intrinsics/gen/abs/005174.wgsl +++ b/test/intrinsics/gen/abs/005174.wgsl @@ -27,8 +27,9 @@ fn abs_005174() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_005174(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl index 2733aaeb75..b824ff5495 100644 --- a/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_005174() { float3 res = abs(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { abs_005174(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.msl b/test/intrinsics/gen/abs/005174.wgsl.expected.msl index 333bdcaaeb..3babfb79ba 100644 --- a/test/intrinsics/gen/abs/005174.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_005174() { float3 res = fabs(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_005174(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm index 3c4c07511e..cf479cfe08 100644 --- a/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_005174 "abs_005174" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_005174 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 FAbs %12 - OpStore %res %9 + %abs_005174 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 FAbs %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %abs_005174 + %26 = OpFunctionCall %void %abs_005174 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %abs_005174 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %abs_005174 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %abs_005174 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %abs_005174 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl index 0d0cb37c57..e99e22480e 100644 --- a/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_005174() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_005174(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/1ce782.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl index bc537633f7..de90d83cd7 100644 --- a/test/intrinsics/gen/abs/1ce782.wgsl +++ b/test/intrinsics/gen/abs/1ce782.wgsl @@ -27,8 +27,9 @@ fn abs_1ce782() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_1ce782(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl index dc858cbc2c..684aae13b2 100644 --- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_1ce782() { uint4 res = abs(uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { abs_1ce782(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl index 5f35a135bb..987b8fb8f1 100644 --- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_1ce782() { uint4 res = abs(uint4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_1ce782(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm index d791e6213b..80b913301b 100644 --- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_1ce782 "abs_1ce782" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %13 = OpConstantNull %v4uint + %17 = OpConstantNull %v4uint %_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_1ce782 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %13 - %9 = OpExtInst %v4uint %12 SAbs %13 - OpStore %res %9 + %abs_1ce782 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %17 + %13 = OpExtInst %v4uint %16 SAbs %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_1ce782 + %27 = OpFunctionCall %void %abs_1ce782 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_1ce782 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_1ce782 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_1ce782 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_1ce782 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl index 5bf8abe987..44b1f87f78 100644 --- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_1ce782() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_1ce782(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl index 4ad1136ae6..4799dbf366 100644 --- a/test/intrinsics/gen/abs/1e9d53.wgsl +++ b/test/intrinsics/gen/abs/1e9d53.wgsl @@ -27,8 +27,9 @@ fn abs_1e9d53() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_1e9d53(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl index 5c0e7012d1..b6a925eb3a 100644 --- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_1e9d53() { float2 res = abs(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { abs_1e9d53(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl index f126e825e2..944edf8b6e 100644 --- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_1e9d53() { float2 res = fabs(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_1e9d53(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm index 815fcf90de..64cd558aae 100644 --- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_1e9d53 "abs_1e9d53" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_1e9d53 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 FAbs %12 - OpStore %res %9 + %abs_1e9d53 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 FAbs %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %abs_1e9d53 + %26 = OpFunctionCall %void %abs_1e9d53 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %abs_1e9d53 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %abs_1e9d53 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %abs_1e9d53 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %abs_1e9d53 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl index 1e51a1f026..1e7f60a59f 100644 --- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_1e9d53() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_1e9d53(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/467cd1.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl index 422ee720c9..03cf6e473a 100644 --- a/test/intrinsics/gen/abs/467cd1.wgsl +++ b/test/intrinsics/gen/abs/467cd1.wgsl @@ -27,8 +27,9 @@ fn abs_467cd1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_467cd1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl index 0728dea0ca..ac455489d5 100644 --- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_467cd1() { uint res = abs(1u); } -void vertex_main() { +tint_symbol vertex_main() { abs_467cd1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl index 63d83b35f5..76477c2074 100644 --- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_467cd1() { uint res = abs(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_467cd1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm index 7af5b05ece..9ad9cb30e9 100644 --- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_467cd1 "abs_467cd1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_uint = OpTypePointer Function %uint - %15 = OpConstantNull %uint + %19 = OpConstantNull %uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_467cd1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %15 - %9 = OpExtInst %uint %11 SAbs %uint_1 - OpStore %res %9 + %abs_467cd1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %19 + %13 = OpExtInst %uint %15 SAbs %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_467cd1 + %27 = OpFunctionCall %void %abs_467cd1 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_467cd1 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_467cd1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_467cd1 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_467cd1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl index b40916d2f5..c316c5049e 100644 --- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_467cd1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_467cd1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/4ad288.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl index 0105439916..08fcabc351 100644 --- a/test/intrinsics/gen/abs/4ad288.wgsl +++ b/test/intrinsics/gen/abs/4ad288.wgsl @@ -27,8 +27,9 @@ fn abs_4ad288() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_4ad288(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl index e7ff244109..6c6afef35a 100644 --- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_4ad288() { int res = abs(1); } -void vertex_main() { +tint_symbol vertex_main() { abs_4ad288(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl index c454219341..081a99450d 100644 --- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_4ad288() { int res = abs(1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_4ad288(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm index bb37f0715a..a037803cad 100644 --- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_4ad288 "abs_4ad288" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_int = OpTypePointer Function %int - %15 = OpConstantNull %int + %19 = OpConstantNull %int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_4ad288 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_int Function %15 - %9 = OpExtInst %int %11 SAbs %int_1 - OpStore %res %9 + %abs_4ad288 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %13 = OpExtInst %int %15 SAbs %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_4ad288 + %27 = OpFunctionCall %void %abs_4ad288 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_4ad288 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_4ad288 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_4ad288 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_4ad288 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl index 2842caf0a3..c996801b1e 100644 --- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_4ad288() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_4ad288(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl index 5b305f88d8..a5d420f013 100644 --- a/test/intrinsics/gen/abs/5ad50a.wgsl +++ b/test/intrinsics/gen/abs/5ad50a.wgsl @@ -27,8 +27,9 @@ fn abs_5ad50a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_5ad50a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl index 075e3cfb50..86eee8b182 100644 --- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_5ad50a() { int3 res = abs(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { abs_5ad50a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl index 2d542b82fa..bcc027bc62 100644 --- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_5ad50a() { int3 res = abs(int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_5ad50a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm index 3419005924..f5a5d0c584 100644 --- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_5ad50a "abs_5ad50a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %13 = OpConstantNull %v3int + %17 = OpConstantNull %v3int %_ptr_Function_v3int = OpTypePointer Function %v3int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_5ad50a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %13 - %9 = OpExtInst %v3int %12 SAbs %13 - OpStore %res %9 + %abs_5ad50a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %17 + %13 = OpExtInst %v3int %16 SAbs %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_5ad50a + %27 = OpFunctionCall %void %abs_5ad50a + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_5ad50a +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_5ad50a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_5ad50a +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_5ad50a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl index ec7efb6d2a..dd82456004 100644 --- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_5ad50a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_5ad50a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/7326de.wgsl b/test/intrinsics/gen/abs/7326de.wgsl index d32d55f3bb..aff9ddcc8a 100644 --- a/test/intrinsics/gen/abs/7326de.wgsl +++ b/test/intrinsics/gen/abs/7326de.wgsl @@ -27,8 +27,9 @@ fn abs_7326de() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_7326de(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl index 1452464479..48d4e3d833 100644 --- a/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_7326de() { uint3 res = abs(uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { abs_7326de(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl index 9c2eb81528..3de8a49b67 100644 --- a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_7326de() { uint3 res = abs(uint3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_7326de(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm index 55422b30f6..4ea8984ac0 100644 --- a/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_7326de "abs_7326de" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %13 = OpConstantNull %v3uint + %17 = OpConstantNull %v3uint %_ptr_Function_v3uint = OpTypePointer Function %v3uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_7326de = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3uint Function %13 - %9 = OpExtInst %v3uint %12 SAbs %13 - OpStore %res %9 + %abs_7326de = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %17 + %13 = OpExtInst %v3uint %16 SAbs %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_7326de + %27 = OpFunctionCall %void %abs_7326de + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_7326de +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_7326de OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_7326de +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_7326de OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl index 0cd0f3c8be..c3c58bfe9d 100644 --- a/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_7326de() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_7326de(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl index 60f0174672..e90960afc5 100644 --- a/test/intrinsics/gen/abs/7f28e6.wgsl +++ b/test/intrinsics/gen/abs/7f28e6.wgsl @@ -27,8 +27,9 @@ fn abs_7f28e6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_7f28e6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl index c2394dae6b..b73df9fecc 100644 --- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_7f28e6() { uint2 res = abs(uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { abs_7f28e6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl index 9ec60604ad..9c154aa4ad 100644 --- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_7f28e6() { uint2 res = abs(uint2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_7f28e6(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm index b3cffe166d..fc456ae557 100644 --- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_7f28e6 "abs_7f28e6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %13 = OpConstantNull %v2uint + %17 = OpConstantNull %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_7f28e6 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2uint Function %13 - %9 = OpExtInst %v2uint %12 SAbs %13 - OpStore %res %9 + %abs_7f28e6 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %17 + %13 = OpExtInst %v2uint %16 SAbs %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_7f28e6 + %27 = OpFunctionCall %void %abs_7f28e6 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_7f28e6 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_7f28e6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_7f28e6 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_7f28e6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl index 53a7554a8d..b45856f90c 100644 --- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_7f28e6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_7f28e6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl index c676477bf2..de36887f52 100644 --- a/test/intrinsics/gen/abs/7faa9e.wgsl +++ b/test/intrinsics/gen/abs/7faa9e.wgsl @@ -27,8 +27,9 @@ fn abs_7faa9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_7faa9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl index 80607a0913..0f4908a91b 100644 --- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_7faa9e() { int2 res = abs(int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { abs_7faa9e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl index 9b6091853a..d4e466898c 100644 --- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_7faa9e() { int2 res = abs(int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_7faa9e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm index 76f9674acc..22d8436e98 100644 --- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_7faa9e "abs_7faa9e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %13 = OpConstantNull %v2int + %17 = OpConstantNull %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_7faa9e = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %13 - %9 = OpExtInst %v2int %12 SAbs %13 - OpStore %res %9 + %abs_7faa9e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %17 + %13 = OpExtInst %v2int %16 SAbs %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_7faa9e + %27 = OpFunctionCall %void %abs_7faa9e + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_7faa9e +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_7faa9e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_7faa9e +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_7faa9e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl index c2f73f679b..5ddcfb7e6c 100644 --- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_7faa9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_7faa9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl index 05e66e2c27..1aefbb5c1b 100644 --- a/test/intrinsics/gen/abs/9c80a6.wgsl +++ b/test/intrinsics/gen/abs/9c80a6.wgsl @@ -27,8 +27,9 @@ fn abs_9c80a6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_9c80a6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl index fb08caba72..4519edfda0 100644 --- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_9c80a6() { int4 res = abs(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { abs_9c80a6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl index 26f8447172..09179b9031 100644 --- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_9c80a6() { int4 res = abs(int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_9c80a6(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm index c3806cee25..b94f60d7f4 100644 --- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_9c80a6 "abs_9c80a6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %13 = OpConstantNull %v4int + %17 = OpConstantNull %v4int %_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %abs_9c80a6 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %13 - %9 = OpExtInst %v4int %12 SAbs %13 - OpStore %res %9 + %abs_9c80a6 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %17 + %13 = OpExtInst %v4int %16 SAbs %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %abs_9c80a6 + %27 = OpFunctionCall %void %abs_9c80a6 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %abs_9c80a6 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_9c80a6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %abs_9c80a6 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %abs_9c80a6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl index 797774ca9a..7561c573d4 100644 --- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_9c80a6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_9c80a6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/b96037.wgsl b/test/intrinsics/gen/abs/b96037.wgsl index cd0e4316ff..90b2e83fe5 100644 --- a/test/intrinsics/gen/abs/b96037.wgsl +++ b/test/intrinsics/gen/abs/b96037.wgsl @@ -27,8 +27,9 @@ fn abs_b96037() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_b96037(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl index 655840a8e2..83e60baee7 100644 --- a/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void abs_b96037() { float res = abs(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { abs_b96037(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl index f2db329957..86cbf29612 100644 --- a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void abs_b96037() { float res = fabs(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { abs_b96037(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm index af85239784..694ea15c27 100644 --- a/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %abs_b96037 "abs_b96037" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %abs_b96037 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %abs_b96037 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 FAbs %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 FAbs %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %abs_b96037 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %abs_b96037 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %abs_b96037 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %abs_b96037 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %abs_b96037 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %abs_b96037 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl index 112c0a18fa..ff5f274f01 100644 --- a/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn abs_b96037() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { abs_b96037(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/489247.wgsl b/test/intrinsics/gen/acos/489247.wgsl index 091f732b0d..a05a97dd38 100644 --- a/test/intrinsics/gen/acos/489247.wgsl +++ b/test/intrinsics/gen/acos/489247.wgsl @@ -27,8 +27,9 @@ fn acos_489247() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_489247(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl index f5c0610fb4..e32b25a2de 100644 --- a/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void acos_489247() { float res = acos(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { acos_489247(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.msl b/test/intrinsics/gen/acos/489247.wgsl.expected.msl index 1f9a49d762..8a12c8abee 100644 --- a/test/intrinsics/gen/acos/489247.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void acos_489247() { float res = acos(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { acos_489247(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm index 55b34321cf..e4b88798c7 100644 --- a/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %acos_489247 "acos_489247" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%acos_489247 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%acos_489247 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Acos %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Acos %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %acos_489247 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %acos_489247 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %acos_489247 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %acos_489247 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %acos_489247 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %acos_489247 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl index 4c8f3cc7aa..23c4b4b236 100644 --- a/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn acos_489247() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_489247(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl index 0c15ac2061..1df912ca91 100644 --- a/test/intrinsics/gen/acos/8e2acf.wgsl +++ b/test/intrinsics/gen/acos/8e2acf.wgsl @@ -27,8 +27,9 @@ fn acos_8e2acf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_8e2acf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl index df055b2eef..1a192bc5f4 100644 --- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void acos_8e2acf() { float4 res = acos(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { acos_8e2acf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl index 56875a7b1d..fe56d67e19 100644 --- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void acos_8e2acf() { float4 res = acos(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { acos_8e2acf(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm index 0b7021c75a..da5d306146 100644 --- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %acos_8e2acf "acos_8e2acf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%acos_8e2acf = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Acos %12 - OpStore %res %9 +%acos_8e2acf = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Acos %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %acos_8e2acf - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %acos_8e2acf + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %acos_8e2acf + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %acos_8e2acf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %acos_8e2acf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl index 8cce3c553b..807d1615c0 100644 --- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn acos_8e2acf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_8e2acf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/a610c4.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl index d55e6bcd9e..13f8f13057 100644 --- a/test/intrinsics/gen/acos/a610c4.wgsl +++ b/test/intrinsics/gen/acos/a610c4.wgsl @@ -27,8 +27,9 @@ fn acos_a610c4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_a610c4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl index d30ba41ede..c6b468cdfa 100644 --- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void acos_a610c4() { float3 res = acos(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { acos_a610c4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl index d5e7574921..aaf328f029 100644 --- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void acos_a610c4() { float3 res = acos(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { acos_a610c4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm index 1f6a49234c..df7fe1e571 100644 --- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %acos_a610c4 "acos_a610c4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%acos_a610c4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Acos %12 - OpStore %res %9 +%acos_a610c4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Acos %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %acos_a610c4 + %26 = OpFunctionCall %void %acos_a610c4 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %acos_a610c4 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %acos_a610c4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %acos_a610c4 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %acos_a610c4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl index 8c17039c47..e5b939039b 100644 --- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn acos_a610c4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_a610c4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/dfc915.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl index d6962e0643..239f89d087 100644 --- a/test/intrinsics/gen/acos/dfc915.wgsl +++ b/test/intrinsics/gen/acos/dfc915.wgsl @@ -27,8 +27,9 @@ fn acos_dfc915() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_dfc915(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl index 9ae2fb0a7a..3ba67143d4 100644 --- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void acos_dfc915() { float2 res = acos(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { acos_dfc915(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl index f0b5e6d988..9257d33cb2 100644 --- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void acos_dfc915() { float2 res = acos(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { acos_dfc915(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm index 47e584dea1..117ffe9c4e 100644 --- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %acos_dfc915 "acos_dfc915" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%acos_dfc915 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Acos %12 - OpStore %res %9 +%acos_dfc915 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Acos %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %acos_dfc915 + %26 = OpFunctionCall %void %acos_dfc915 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %acos_dfc915 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %acos_dfc915 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %acos_dfc915 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %acos_dfc915 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl index 2ee1383071..d8652329ad 100644 --- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn acos_dfc915() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { acos_dfc915(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/all/986c7b.wgsl b/test/intrinsics/gen/all/986c7b.wgsl index ccef7223af..9fe2e69e5d 100644 --- a/test/intrinsics/gen/all/986c7b.wgsl +++ b/test/intrinsics/gen/all/986c7b.wgsl @@ -27,8 +27,9 @@ fn all_986c7b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { all_986c7b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl index ddb983b462..ed1d46053e 100644 --- a/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void all_986c7b() { bool res = all(vector(false, false, false, false)); } -void vertex_main() { +tint_symbol vertex_main() { all_986c7b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl index 702a3655f4..022b58ec1a 100644 --- a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void all_986c7b() { bool res = all(bool4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { all_986c7b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm index 2c6a391824..c2fce04a24 100644 --- a/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %all_986c7b "all_986c7b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %12 = OpConstantNull %v4bool + %16 = OpConstantNull %v4bool %_ptr_Function_bool = OpTypePointer Function %bool - %15 = OpConstantNull %bool + %19 = OpConstantNull %bool + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %all_986c7b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %15 - %9 = OpAll %bool %12 - OpStore %res %9 + %all_986c7b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %19 + %13 = OpAll %bool %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %all_986c7b + %27 = OpFunctionCall %void %all_986c7b + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %all_986c7b +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %all_986c7b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %all_986c7b +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %all_986c7b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl index 16db50e4e0..242ced4979 100644 --- a/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn all_986c7b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { all_986c7b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/all/bd2dba.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl index 69853b7f57..4f0dbd220e 100644 --- a/test/intrinsics/gen/all/bd2dba.wgsl +++ b/test/intrinsics/gen/all/bd2dba.wgsl @@ -27,8 +27,9 @@ fn all_bd2dba() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { all_bd2dba(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl index f49a0e7519..93b3bba06e 100644 --- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void all_bd2dba() { bool res = all(vector(false, false, false)); } -void vertex_main() { +tint_symbol vertex_main() { all_bd2dba(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl index 3425ed2ec2..9ad60e35d7 100644 --- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void all_bd2dba() { bool res = all(bool3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { all_bd2dba(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm index 8c95c4570d..b9224d4dd2 100644 --- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %all_bd2dba "all_bd2dba" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 - %12 = OpConstantNull %v3bool + %16 = OpConstantNull %v3bool %_ptr_Function_bool = OpTypePointer Function %bool - %15 = OpConstantNull %bool + %19 = OpConstantNull %bool + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %all_bd2dba = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %15 - %9 = OpAll %bool %12 - OpStore %res %9 + %all_bd2dba = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %19 + %13 = OpAll %bool %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %all_bd2dba + %27 = OpFunctionCall %void %all_bd2dba + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %all_bd2dba +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %all_bd2dba OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %all_bd2dba +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %all_bd2dba OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl index 718116c835..a730330a10 100644 --- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn all_bd2dba() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { all_bd2dba(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/all/f46790.wgsl b/test/intrinsics/gen/all/f46790.wgsl index 541a718c4a..a41b8dc458 100644 --- a/test/intrinsics/gen/all/f46790.wgsl +++ b/test/intrinsics/gen/all/f46790.wgsl @@ -27,8 +27,9 @@ fn all_f46790() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { all_f46790(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl index 6b954b66f6..d4d0393e52 100644 --- a/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void all_f46790() { bool res = all(vector(false, false)); } -void vertex_main() { +tint_symbol vertex_main() { all_f46790(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.msl b/test/intrinsics/gen/all/f46790.wgsl.expected.msl index 3c9019a5ae..f2813f5ce4 100644 --- a/test/intrinsics/gen/all/f46790.wgsl.expected.msl +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void all_f46790() { bool res = all(bool2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { all_f46790(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm index 081db4a7d4..0fe41650cd 100644 --- a/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %all_f46790 "all_f46790" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 - %12 = OpConstantNull %v2bool + %16 = OpConstantNull %v2bool %_ptr_Function_bool = OpTypePointer Function %bool - %15 = OpConstantNull %bool + %19 = OpConstantNull %bool + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %all_f46790 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %15 - %9 = OpAll %bool %12 - OpStore %res %9 + %all_f46790 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %19 + %13 = OpAll %bool %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %all_f46790 + %27 = OpFunctionCall %void %all_f46790 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %all_f46790 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %all_f46790 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %all_f46790 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %all_f46790 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl index 2b156aed7d..aa07e025d0 100644 --- a/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn all_f46790() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { all_f46790(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/any/083428.wgsl b/test/intrinsics/gen/any/083428.wgsl index 9453c9cd71..c31c551b55 100644 --- a/test/intrinsics/gen/any/083428.wgsl +++ b/test/intrinsics/gen/any/083428.wgsl @@ -27,8 +27,9 @@ fn any_083428() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { any_083428(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.hlsl b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl index 10dfae8182..e70364e2f8 100644 --- a/test/intrinsics/gen/any/083428.wgsl.expected.hlsl +++ b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void any_083428() { bool res = any(vector(false, false, false, false)); } -void vertex_main() { +tint_symbol vertex_main() { any_083428(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.msl b/test/intrinsics/gen/any/083428.wgsl.expected.msl index 08107920d7..3b69c0a901 100644 --- a/test/intrinsics/gen/any/083428.wgsl.expected.msl +++ b/test/intrinsics/gen/any/083428.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void any_083428() { bool res = any(bool4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { any_083428(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.spvasm b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm index 8ed460e039..29ba54d80b 100644 --- a/test/intrinsics/gen/any/083428.wgsl.expected.spvasm +++ b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %any_083428 "any_083428" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %12 = OpConstantNull %v4bool + %16 = OpConstantNull %v4bool %_ptr_Function_bool = OpTypePointer Function %bool - %15 = OpConstantNull %bool + %19 = OpConstantNull %bool + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %any_083428 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %15 - %9 = OpAny %bool %12 - OpStore %res %9 + %any_083428 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %19 + %13 = OpAny %bool %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %any_083428 + %27 = OpFunctionCall %void %any_083428 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %any_083428 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %any_083428 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %any_083428 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %any_083428 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.wgsl b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl index aa9e120e9e..c70201fa90 100644 --- a/test/intrinsics/gen/any/083428.wgsl.expected.wgsl +++ b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn any_083428() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { any_083428(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/any/0e3e58.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl index 16806adc24..b7f4db22b7 100644 --- a/test/intrinsics/gen/any/0e3e58.wgsl +++ b/test/intrinsics/gen/any/0e3e58.wgsl @@ -27,8 +27,9 @@ fn any_0e3e58() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { any_0e3e58(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl index a1f20004dd..0b9d54a71f 100644 --- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void any_0e3e58() { bool res = any(vector(false, false)); } -void vertex_main() { +tint_symbol vertex_main() { any_0e3e58(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl index b9ba7b21f9..8efaca17de 100644 --- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void any_0e3e58() { bool res = any(bool2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { any_0e3e58(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm index 1bfea9ec62..3e772c9abe 100644 --- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %any_0e3e58 "any_0e3e58" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 - %12 = OpConstantNull %v2bool + %16 = OpConstantNull %v2bool %_ptr_Function_bool = OpTypePointer Function %bool - %15 = OpConstantNull %bool + %19 = OpConstantNull %bool + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %any_0e3e58 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %15 - %9 = OpAny %bool %12 - OpStore %res %9 + %any_0e3e58 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %19 + %13 = OpAny %bool %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %any_0e3e58 + %27 = OpFunctionCall %void %any_0e3e58 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %any_0e3e58 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %any_0e3e58 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %any_0e3e58 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %any_0e3e58 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl index 7a8e246628..cdb87db357 100644 --- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn any_0e3e58() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { any_0e3e58(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/any/e755c1.wgsl b/test/intrinsics/gen/any/e755c1.wgsl index e1cef53b4b..622c1ea755 100644 --- a/test/intrinsics/gen/any/e755c1.wgsl +++ b/test/intrinsics/gen/any/e755c1.wgsl @@ -27,8 +27,9 @@ fn any_e755c1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { any_e755c1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl index 677e6d5466..1130198771 100644 --- a/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void any_e755c1() { bool res = any(vector(false, false, false)); } -void vertex_main() { +tint_symbol vertex_main() { any_e755c1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl index 33f94096d5..0814a030b4 100644 --- a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void any_e755c1() { bool res = any(bool3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { any_e755c1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm index 613d10b141..29c726f303 100644 --- a/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %any_e755c1 "any_e755c1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 - %12 = OpConstantNull %v3bool + %16 = OpConstantNull %v3bool %_ptr_Function_bool = OpTypePointer Function %bool - %15 = OpConstantNull %bool + %19 = OpConstantNull %bool + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %any_e755c1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %15 - %9 = OpAny %bool %12 - OpStore %res %9 + %any_e755c1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %19 + %13 = OpAny %bool %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %any_e755c1 + %27 = OpFunctionCall %void %any_e755c1 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %any_e755c1 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %any_e755c1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %any_e755c1 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %any_e755c1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl index ab6f7a7ea5..fae0df6ba7 100644 --- a/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn any_e755c1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { any_e755c1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl index 84239adc15..3fa6e381b5 100644 --- a/test/intrinsics/gen/arrayLength/647a40.wgsl +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl @@ -32,8 +32,9 @@ fn arrayLength_647a40() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { arrayLength_647a40(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl index 3d51ff4dfe..859f61e080 100644 --- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl @@ -1,16 +1,20 @@ +struct tint_symbol { + float4 value : SV_Position; +}; ByteAddressBuffer sb : register(t0, space0); void arrayLength_647a40() { - uint tint_symbol_1 = 0u; - sb.GetDimensions(tint_symbol_1); - const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); - uint res = tint_symbol_2; + uint tint_symbol_2 = 0u; + sb.GetDimensions(tint_symbol_2); + const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u); + uint res = tint_symbol_3; } -void vertex_main() { +tint_symbol vertex_main() { arrayLength_647a40(); - return; + const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_4; } void fragment_main() { diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm index 4f70f0be73..518d2d7685 100644 --- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -14,8 +14,11 @@ OpName %SB "SB" OpMemberName %SB 0 "arg_0" OpName %sb "sb" + OpName %tint_symbol_1 "tint_symbol_1" OpName %arrayLength_647a40 "arrayLength_647a40" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -26,6 +29,7 @@ OpDecorate %sb NonWritable OpDecorate %sb DescriptorSet 0 OpDecorate %sb Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -35,31 +39,43 @@ %SB = OpTypeStruct %_runtimearr_uint %_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %13 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13 %void = OpTypeVoid - %10 = OpTypeFunction %void + %14 = OpTypeFunction %void %_ptr_Function_uint = OpTypePointer Function %uint - %17 = OpConstantNull %uint + %21 = OpConstantNull %uint + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%arrayLength_647a40 = OpFunction %void None %10 - %13 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %17 - %14 = OpArrayLength %uint %sb 0 - OpStore %res %14 +%arrayLength_647a40 = OpFunction %void None %14 + %17 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %21 + %18 = OpArrayLength %uint %sb 0 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %10 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %14 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %arrayLength_647a40 + %29 = OpFunctionCall %void %arrayLength_647a40 + %30 = OpFunctionCall %void %tint_symbol_2 %13 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %10 - %23 = OpLabel - %24 = OpFunctionCall %void %arrayLength_647a40 +%fragment_main = OpFunction %void None %14 + %32 = OpLabel + %33 = OpFunctionCall %void %arrayLength_647a40 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %10 - %26 = OpLabel - %27 = OpFunctionCall %void %arrayLength_647a40 +%compute_main = OpFunction %void None %14 + %35 = OpLabel + %36 = OpFunctionCall %void %arrayLength_647a40 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl index 4f420f8cb7..271971637c 100644 --- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl @@ -10,8 +10,9 @@ fn arrayLength_647a40() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { arrayLength_647a40(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl index a502bf7a73..1bf15a8d90 100644 --- a/test/intrinsics/gen/arrayLength/721c9d.wgsl +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl @@ -32,8 +32,9 @@ fn arrayLength_721c9d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { arrayLength_721c9d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl index e7770ff236..5565005a8b 100644 --- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl @@ -1,16 +1,20 @@ +struct tint_symbol { + float4 value : SV_Position; +}; ByteAddressBuffer sb : register(t0, space0); void arrayLength_721c9d() { - uint tint_symbol_1 = 0u; - sb.GetDimensions(tint_symbol_1); - const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); - uint res = tint_symbol_2; + uint tint_symbol_2 = 0u; + sb.GetDimensions(tint_symbol_2); + const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u); + uint res = tint_symbol_3; } -void vertex_main() { +tint_symbol vertex_main() { arrayLength_721c9d(); - return; + const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_4; } void fragment_main() { diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm index 40294aa334..d41bd3b810 100644 --- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -14,8 +14,11 @@ OpName %SB "SB" OpMemberName %SB 0 "arg_0" OpName %sb "sb" + OpName %tint_symbol_1 "tint_symbol_1" OpName %arrayLength_721c9d "arrayLength_721c9d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -26,6 +29,7 @@ OpDecorate %sb NonWritable OpDecorate %sb DescriptorSet 0 OpDecorate %sb Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -35,32 +39,44 @@ %SB = OpTypeStruct %_runtimearr_int %_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %13 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13 %void = OpTypeVoid - %10 = OpTypeFunction %void + %14 = OpTypeFunction %void %uint = OpTypeInt 32 0 %_ptr_Function_uint = OpTypePointer Function %uint - %18 = OpConstantNull %uint + %22 = OpConstantNull %uint + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%arrayLength_721c9d = OpFunction %void None %10 - %13 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %18 - %14 = OpArrayLength %uint %sb 0 - OpStore %res %14 +%arrayLength_721c9d = OpFunction %void None %14 + %17 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %22 + %18 = OpArrayLength %uint %sb 0 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %10 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %14 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %arrayLength_721c9d + %30 = OpFunctionCall %void %arrayLength_721c9d + %31 = OpFunctionCall %void %tint_symbol_2 %13 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %10 - %24 = OpLabel - %25 = OpFunctionCall %void %arrayLength_721c9d +%fragment_main = OpFunction %void None %14 + %33 = OpLabel + %34 = OpFunctionCall %void %arrayLength_721c9d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %10 - %27 = OpLabel - %28 = OpFunctionCall %void %arrayLength_721c9d +%compute_main = OpFunction %void None %14 + %36 = OpLabel + %37 = OpFunctionCall %void %arrayLength_721c9d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl index 57222b1222..963e865e7a 100644 --- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl @@ -10,8 +10,9 @@ fn arrayLength_721c9d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { arrayLength_721c9d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl index 87e31e090b..a48b181ef7 100644 --- a/test/intrinsics/gen/arrayLength/b083be.wgsl +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl @@ -32,8 +32,9 @@ fn arrayLength_b083be() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { arrayLength_b083be(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl index 25c9fd0daa..141f4dee60 100644 --- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl @@ -1,16 +1,20 @@ +struct tint_symbol { + float4 value : SV_Position; +}; ByteAddressBuffer sb : register(t0, space0); void arrayLength_b083be() { - uint tint_symbol_1 = 0u; - sb.GetDimensions(tint_symbol_1); - const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); - uint res = tint_symbol_2; + uint tint_symbol_2 = 0u; + sb.GetDimensions(tint_symbol_2); + const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u); + uint res = tint_symbol_3; } -void vertex_main() { +tint_symbol vertex_main() { arrayLength_b083be(); - return; + const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_4; } void fragment_main() { diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm index 33c66cb144..b3a291f6ac 100644 --- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -14,8 +14,11 @@ OpName %SB "SB" OpMemberName %SB 0 "arg_0" OpName %sb "sb" + OpName %tint_symbol_1 "tint_symbol_1" OpName %arrayLength_b083be "arrayLength_b083be" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -26,6 +29,7 @@ OpDecorate %sb NonWritable OpDecorate %sb DescriptorSet 0 OpDecorate %sb Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -34,32 +38,44 @@ %SB = OpTypeStruct %_runtimearr_float %_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %uint = OpTypeInt 32 0 %_ptr_Function_uint = OpTypePointer Function %uint - %17 = OpConstantNull %uint + %21 = OpConstantNull %uint + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%arrayLength_b083be = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %17 - %13 = OpArrayLength %uint %sb 0 - OpStore %res %13 +%arrayLength_b083be = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %21 + %17 = OpArrayLength %uint %sb 0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %arrayLength_b083be + %29 = OpFunctionCall %void %arrayLength_b083be + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %arrayLength_b083be +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %arrayLength_b083be OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %arrayLength_b083be +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %arrayLength_b083be OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl index 0e156314da..07011895e8 100644 --- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl @@ -10,8 +10,9 @@ fn arrayLength_b083be() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { arrayLength_b083be(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/064953.wgsl b/test/intrinsics/gen/asin/064953.wgsl index ce344004e2..f9e97c91b4 100644 --- a/test/intrinsics/gen/asin/064953.wgsl +++ b/test/intrinsics/gen/asin/064953.wgsl @@ -27,8 +27,9 @@ fn asin_064953() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_064953(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl index 1e260dc456..e996d43c58 100644 --- a/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void asin_064953() { float4 res = asin(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { asin_064953(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.msl b/test/intrinsics/gen/asin/064953.wgsl.expected.msl index ea21d8a8a6..3a5bbebedb 100644 --- a/test/intrinsics/gen/asin/064953.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void asin_064953() { float4 res = asin(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { asin_064953(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm index e98a980ed8..4f4bd4c457 100644 --- a/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %asin_064953 "asin_064953" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%asin_064953 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Asin %12 - OpStore %res %9 +%asin_064953 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Asin %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %asin_064953 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %asin_064953 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %asin_064953 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %asin_064953 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %asin_064953 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl index 0746a72439..f81fc33827 100644 --- a/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn asin_064953() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_064953(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl index 1d522fa15b..71297989cc 100644 --- a/test/intrinsics/gen/asin/7b6a44.wgsl +++ b/test/intrinsics/gen/asin/7b6a44.wgsl @@ -27,8 +27,9 @@ fn asin_7b6a44() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_7b6a44(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl index a013ed10b6..e82903901f 100644 --- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void asin_7b6a44() { float2 res = asin(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { asin_7b6a44(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl index 8e9f1e5535..ae9dd4839c 100644 --- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void asin_7b6a44() { float2 res = asin(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { asin_7b6a44(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm index aca13bec0c..bf48d2d111 100644 --- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %asin_7b6a44 "asin_7b6a44" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%asin_7b6a44 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Asin %12 - OpStore %res %9 +%asin_7b6a44 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Asin %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %asin_7b6a44 + %26 = OpFunctionCall %void %asin_7b6a44 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %asin_7b6a44 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %asin_7b6a44 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %asin_7b6a44 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %asin_7b6a44 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl index 20048a972b..7216c55923 100644 --- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn asin_7b6a44() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_7b6a44(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl index 047d99f6c5..e39903bc24 100644 --- a/test/intrinsics/gen/asin/8cd9c9.wgsl +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl @@ -27,8 +27,9 @@ fn asin_8cd9c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_8cd9c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl index 9215dcd138..a1f8642db4 100644 --- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void asin_8cd9c9() { float3 res = asin(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { asin_8cd9c9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl index 07bd712bd3..e246b62035 100644 --- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void asin_8cd9c9() { float3 res = asin(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { asin_8cd9c9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm index ca65452ae3..2b16759f90 100644 --- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %asin_8cd9c9 "asin_8cd9c9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%asin_8cd9c9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Asin %12 - OpStore %res %9 +%asin_8cd9c9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Asin %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %asin_8cd9c9 + %26 = OpFunctionCall %void %asin_8cd9c9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %asin_8cd9c9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %asin_8cd9c9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %asin_8cd9c9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %asin_8cd9c9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl index a86e69f564..99cc88524d 100644 --- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn asin_8cd9c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_8cd9c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/c0c272.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl index 6c7f9d6539..a707190cc6 100644 --- a/test/intrinsics/gen/asin/c0c272.wgsl +++ b/test/intrinsics/gen/asin/c0c272.wgsl @@ -27,8 +27,9 @@ fn asin_c0c272() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_c0c272(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl index 2c5b742822..58999318c9 100644 --- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void asin_c0c272() { float res = asin(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { asin_c0c272(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl index 87b650d769..8a7e083a2a 100644 --- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void asin_c0c272() { float res = asin(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { asin_c0c272(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm index 7c1af87082..6b5ec45e32 100644 --- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %asin_c0c272 "asin_c0c272" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%asin_c0c272 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%asin_c0c272 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Asin %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Asin %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %asin_c0c272 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %asin_c0c272 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %asin_c0c272 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %asin_c0c272 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %asin_c0c272 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %asin_c0c272 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl index dc482f3f4d..053a48b144 100644 --- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn asin_c0c272() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { asin_c0c272(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/02979a.wgsl b/test/intrinsics/gen/atan/02979a.wgsl index 0756a8c5d2..5baf309d6f 100644 --- a/test/intrinsics/gen/atan/02979a.wgsl +++ b/test/intrinsics/gen/atan/02979a.wgsl @@ -27,8 +27,9 @@ fn atan_02979a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_02979a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl index 03255a92a7..bf84852611 100644 --- a/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void atan_02979a() { float res = atan(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { atan_02979a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl index ad8db82ce1..411c3bd718 100644 --- a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan_02979a() { float res = atan(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan_02979a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm index 5b3a53c551..190f8b89f9 100644 --- a/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan_02979a "atan_02979a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%atan_02979a = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%atan_02979a = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Atan %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Atan %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %atan_02979a - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %atan_02979a - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %atan_02979a + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %atan_02979a + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %atan_02979a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %atan_02979a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl index 02da0b040c..c2a4ab429c 100644 --- a/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan_02979a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_02979a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/331e6d.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl index 2b4def577c..9b8db52fc3 100644 --- a/test/intrinsics/gen/atan/331e6d.wgsl +++ b/test/intrinsics/gen/atan/331e6d.wgsl @@ -27,8 +27,9 @@ fn atan_331e6d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_331e6d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl index 69a677d615..25f15a7348 100644 --- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void atan_331e6d() { float3 res = atan(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { atan_331e6d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl index 77fe0cb610..0978363178 100644 --- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan_331e6d() { float3 res = atan(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan_331e6d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm index 1a1c43d8e8..09d84b5f2f 100644 --- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan_331e6d "atan_331e6d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%atan_331e6d = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Atan %12 - OpStore %res %9 +%atan_331e6d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Atan %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %atan_331e6d + %26 = OpFunctionCall %void %atan_331e6d + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %atan_331e6d +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %atan_331e6d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %atan_331e6d +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %atan_331e6d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl index dd330018e1..3740d19cae 100644 --- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan_331e6d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_331e6d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/a8b696.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl index ab30f52018..e72a052eab 100644 --- a/test/intrinsics/gen/atan/a8b696.wgsl +++ b/test/intrinsics/gen/atan/a8b696.wgsl @@ -27,8 +27,9 @@ fn atan_a8b696() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_a8b696(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl index 10825e8ea2..abebf344c2 100644 --- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void atan_a8b696() { float4 res = atan(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { atan_a8b696(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl index 3c5b1d703c..16ab64acdd 100644 --- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan_a8b696() { float4 res = atan(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan_a8b696(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm index 88f67655e5..745878fdc8 100644 --- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan_a8b696 "atan_a8b696" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%atan_a8b696 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Atan %12 - OpStore %res %9 +%atan_a8b696 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Atan %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %atan_a8b696 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %atan_a8b696 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %atan_a8b696 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %atan_a8b696 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %atan_a8b696 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl index 22e4087f3e..ef893a2471 100644 --- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan_a8b696() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_a8b696(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl index 0ed39c1c8c..7d6cc73f6f 100644 --- a/test/intrinsics/gen/atan/ad96e4.wgsl +++ b/test/intrinsics/gen/atan/ad96e4.wgsl @@ -27,8 +27,9 @@ fn atan_ad96e4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_ad96e4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl index 32b7f3618c..c76ef0e96b 100644 --- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void atan_ad96e4() { float2 res = atan(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { atan_ad96e4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl index d4b1639126..080c24a78d 100644 --- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan_ad96e4() { float2 res = atan(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan_ad96e4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm index 4c1efbf740..6148168f1e 100644 --- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan_ad96e4 "atan_ad96e4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%atan_ad96e4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Atan %12 - OpStore %res %9 +%atan_ad96e4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Atan %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %atan_ad96e4 + %26 = OpFunctionCall %void %atan_ad96e4 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %atan_ad96e4 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %atan_ad96e4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %atan_ad96e4 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %atan_ad96e4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl index 4806af3e94..3b7a634f75 100644 --- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan_ad96e4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan_ad96e4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl index 0d662ca83c..b0d0d3651d 100644 --- a/test/intrinsics/gen/atan2/57fb13.wgsl +++ b/test/intrinsics/gen/atan2/57fb13.wgsl @@ -27,8 +27,9 @@ fn atan2_57fb13() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_57fb13(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl index e6adbc9f12..f647ab6511 100644 --- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan2_57fb13() { float2 res = atan2(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan2_57fb13(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm index 5ad6a7bcbb..a43a4008eb 100644 --- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan2_57fb13 "atan2_57fb13" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%atan2_57fb13 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Atan2 %12 %12 - OpStore %res %9 +%atan2_57fb13 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Atan2 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %atan2_57fb13 + %26 = OpFunctionCall %void %atan2_57fb13 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %atan2_57fb13 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %atan2_57fb13 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %atan2_57fb13 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %atan2_57fb13 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl index 9eeb50ea1e..8dfa7ad927 100644 --- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan2_57fb13() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_57fb13(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/96057c.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl index c48ea4d89b..8a8ef1e2fd 100644 --- a/test/intrinsics/gen/atan2/96057c.wgsl +++ b/test/intrinsics/gen/atan2/96057c.wgsl @@ -27,8 +27,9 @@ fn atan2_96057c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_96057c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl index 6148ace0f5..7663e3217d 100644 --- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void atan2_96057c() { float res = atan2(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { atan2_96057c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl index 6dd610fcad..eda44b5e1b 100644 --- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan2_96057c() { float res = atan2(1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan2_96057c(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm index 2d93e05545..6f09ee670f 100644 --- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan2_96057c "atan2_96057c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%atan2_96057c = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%atan2_96057c = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Atan2 %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Atan2 %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %atan2_96057c - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %atan2_96057c - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %atan2_96057c + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %atan2_96057c + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %atan2_96057c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %atan2_96057c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl index 5196c864fe..a8fa052dc0 100644 --- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan2_96057c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_96057c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl index 9803266040..f94c541332 100644 --- a/test/intrinsics/gen/atan2/a70d0d.wgsl +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl @@ -27,8 +27,9 @@ fn atan2_a70d0d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_a70d0d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl index 867ab02321..6a52430850 100644 --- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan2_a70d0d() { float3 res = atan2(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan2_a70d0d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm index 8a2ce3a972..1ddf16523b 100644 --- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan2_a70d0d "atan2_a70d0d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%atan2_a70d0d = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Atan2 %12 %12 - OpStore %res %9 +%atan2_a70d0d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Atan2 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %atan2_a70d0d + %26 = OpFunctionCall %void %atan2_a70d0d + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %atan2_a70d0d +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %atan2_a70d0d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %atan2_a70d0d +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %atan2_a70d0d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl index 81cbd0b82f..53cc60e3e9 100644 --- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan2_a70d0d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_a70d0d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl index 19090fd66e..d0edde7cbd 100644 --- a/test/intrinsics/gen/atan2/ae713e.wgsl +++ b/test/intrinsics/gen/atan2/ae713e.wgsl @@ -27,8 +27,9 @@ fn atan2_ae713e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_ae713e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl index 5afdaf168f..9aa0aa7869 100644 --- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void atan2_ae713e() { float4 res = atan2(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { atan2_ae713e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm index f97c71eea5..8ecfa940d1 100644 --- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %atan2_ae713e "atan2_ae713e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%atan2_ae713e = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Atan2 %12 %12 - OpStore %res %9 +%atan2_ae713e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Atan2 %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %atan2_ae713e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %atan2_ae713e + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %atan2_ae713e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %atan2_ae713e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %atan2_ae713e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl index 1f36d2f3e0..10880ff41e 100644 --- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn atan2_ae713e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { atan2_ae713e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/34064b.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl index 3a761a8369..30dce20380 100644 --- a/test/intrinsics/gen/ceil/34064b.wgsl +++ b/test/intrinsics/gen/ceil/34064b.wgsl @@ -27,8 +27,9 @@ fn ceil_34064b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_34064b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl index 8a08ba8e5d..83a777cde1 100644 --- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ceil_34064b() { float3 res = ceil(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { ceil_34064b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl index bdee65cf31..6a9eba075a 100644 --- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ceil_34064b() { float3 res = ceil(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ceil_34064b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm index 93ef755a27..ddfaf871a2 100644 --- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ceil_34064b "ceil_34064b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ceil_34064b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Ceil %12 - OpStore %res %9 +%ceil_34064b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Ceil %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %ceil_34064b + %26 = OpFunctionCall %void %ceil_34064b + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %ceil_34064b +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %ceil_34064b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %ceil_34064b +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ceil_34064b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl index db216bd860..745dd840c2 100644 --- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ceil_34064b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_34064b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/678655.wgsl b/test/intrinsics/gen/ceil/678655.wgsl index d6fd59e099..d3abe6d2f6 100644 --- a/test/intrinsics/gen/ceil/678655.wgsl +++ b/test/intrinsics/gen/ceil/678655.wgsl @@ -27,8 +27,9 @@ fn ceil_678655() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_678655(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl index a4644710c8..6c0838ea38 100644 --- a/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ceil_678655() { float res = ceil(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { ceil_678655(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl index 2ee1b99c98..1dc8a90376 100644 --- a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ceil_678655() { float res = ceil(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ceil_678655(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm index 7e9d904fad..81b81aaa71 100644 --- a/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ceil_678655 "ceil_678655" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%ceil_678655 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%ceil_678655 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Ceil %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Ceil %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %ceil_678655 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %ceil_678655 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %ceil_678655 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %ceil_678655 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %ceil_678655 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %ceil_678655 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl index 93141ee49c..c4c8b8c287 100644 --- a/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ceil_678655() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_678655(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/96f597.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl index 8be5f582ac..8015830618 100644 --- a/test/intrinsics/gen/ceil/96f597.wgsl +++ b/test/intrinsics/gen/ceil/96f597.wgsl @@ -27,8 +27,9 @@ fn ceil_96f597() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_96f597(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl index 0c6ec138d6..f27af89546 100644 --- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ceil_96f597() { float2 res = ceil(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { ceil_96f597(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl index e7fac87e57..355e7c3d9c 100644 --- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ceil_96f597() { float2 res = ceil(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ceil_96f597(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm index 2c6fc2dbf7..cb88aba280 100644 --- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ceil_96f597 "ceil_96f597" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ceil_96f597 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Ceil %12 - OpStore %res %9 +%ceil_96f597 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Ceil %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %ceil_96f597 + %26 = OpFunctionCall %void %ceil_96f597 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %ceil_96f597 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %ceil_96f597 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %ceil_96f597 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ceil_96f597 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl index 0f19eb3b92..08659772e8 100644 --- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ceil_96f597() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_96f597(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl index bff6a37cf6..c1e2ed4c3b 100644 --- a/test/intrinsics/gen/ceil/b74c16.wgsl +++ b/test/intrinsics/gen/ceil/b74c16.wgsl @@ -27,8 +27,9 @@ fn ceil_b74c16() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_b74c16(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl index 8a24e8fd8b..77772ec068 100644 --- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ceil_b74c16() { float4 res = ceil(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { ceil_b74c16(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl index 85755c87c1..982d1d0f31 100644 --- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ceil_b74c16() { float4 res = ceil(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ceil_b74c16(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm index 8acc0f5e58..80145396e4 100644 --- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ceil_b74c16 "ceil_b74c16" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ceil_b74c16 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Ceil %12 - OpStore %res %9 +%ceil_b74c16 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Ceil %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %ceil_b74c16 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %ceil_b74c16 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %ceil_b74c16 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %ceil_b74c16 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %ceil_b74c16 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl index 31a84dc532..054a6f3616 100644 --- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ceil_b74c16() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ceil_b74c16(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl index 1cd0210de6..1936ba52c1 100644 --- a/test/intrinsics/gen/clamp/0acf8f.wgsl +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl @@ -27,8 +27,9 @@ fn clamp_0acf8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_0acf8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl index 842215f1c3..46ebedcf03 100644 --- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_0acf8f() { float2 res = clamp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_0acf8f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl index a037369fb8..dce861e9fc 100644 --- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_0acf8f() { float2 res = clamp(float2(), float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_0acf8f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm index 407ba2e23d..67d351d2e5 100644 --- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_0acf8f "clamp_0acf8f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_0acf8f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 NClamp %12 %12 %12 - OpStore %res %9 +%clamp_0acf8f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 NClamp %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %clamp_0acf8f + %26 = OpFunctionCall %void %clamp_0acf8f + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %clamp_0acf8f +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %clamp_0acf8f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %clamp_0acf8f +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %clamp_0acf8f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl index bddaa44a8d..5c836710a5 100644 --- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_0acf8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_0acf8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl index 09c42a5cba..8444c85c61 100644 --- a/test/intrinsics/gen/clamp/1a32e3.wgsl +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl @@ -27,8 +27,9 @@ fn clamp_1a32e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_1a32e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl index 55b87de903..7041713dd2 100644 --- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_1a32e3() { int4 res = clamp(int4(0, 0, 0, 0), int4(0, 0, 0, 0), int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_1a32e3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl index c0bea6f649..062a582920 100644 --- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_1a32e3() { int4 res = clamp(int4(), int4(), int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_1a32e3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm index 33593799b4..975e5221c2 100644 --- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_1a32e3 "clamp_1a32e3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %13 = OpConstantNull %v4int + %17 = OpConstantNull %v4int %_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_1a32e3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %13 - %9 = OpExtInst %v4int %12 SClamp %13 %13 %13 - OpStore %res %9 +%clamp_1a32e3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %17 + %13 = OpExtInst %v4int %16 SClamp %17 %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_1a32e3 + %27 = OpFunctionCall %void %clamp_1a32e3 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_1a32e3 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_1a32e3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_1a32e3 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_1a32e3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl index 27ba95d975..b06bed0ff2 100644 --- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_1a32e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_1a32e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl index 53f74c8f4f..d40062367b 100644 --- a/test/intrinsics/gen/clamp/2bd567.wgsl +++ b/test/intrinsics/gen/clamp/2bd567.wgsl @@ -27,8 +27,9 @@ fn clamp_2bd567() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_2bd567(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl index 6650a46d0c..2957e22039 100644 --- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_2bd567() { float res = clamp(1.0f, 1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { clamp_2bd567(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl index fd397f1988..533e9e400d 100644 --- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_2bd567() { float res = clamp(1.0f, 1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_2bd567(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm index 74eb006834..011022b3bf 100644 --- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_2bd567 "clamp_2bd567" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%clamp_2bd567 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%clamp_2bd567 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 NClamp %float_1 %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 NClamp %float_1 %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %clamp_2bd567 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %clamp_2bd567 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %clamp_2bd567 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %clamp_2bd567 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %clamp_2bd567 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_2bd567 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl index 84ab121635..709aec4e37 100644 --- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_2bd567() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_2bd567(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl index d3e75b0e69..9c84393d77 100644 --- a/test/intrinsics/gen/clamp/2bde41.wgsl +++ b/test/intrinsics/gen/clamp/2bde41.wgsl @@ -27,8 +27,9 @@ fn clamp_2bde41() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_2bde41(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl index f6485cb037..d8a1a6bdf4 100644 --- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_2bde41() { float4 res = clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_2bde41(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl index 300b88a087..aa99935b57 100644 --- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_2bde41() { float4 res = clamp(float4(), float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_2bde41(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm index 893bd08ef5..a6e827644d 100644 --- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_2bde41 "clamp_2bde41" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_2bde41 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 NClamp %12 %12 %12 - OpStore %res %9 +%clamp_2bde41 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 NClamp %8 %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %clamp_2bde41 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %clamp_2bde41 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %clamp_2bde41 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %clamp_2bde41 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_2bde41 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl index 5956f67d6e..25ecf8f007 100644 --- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_2bde41() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_2bde41(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl index c1c22c5836..73c3086e26 100644 --- a/test/intrinsics/gen/clamp/548fc7.wgsl +++ b/test/intrinsics/gen/clamp/548fc7.wgsl @@ -27,8 +27,9 @@ fn clamp_548fc7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_548fc7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl index 019054e243..d8be53e4f1 100644 --- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_548fc7() { uint3 res = clamp(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u), uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_548fc7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl index cd95893cf1..ecfc1ad54a 100644 --- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_548fc7() { uint3 res = clamp(uint3(), uint3(), uint3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_548fc7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm index 37f7fb724f..dbcf07d8c5 100644 --- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_548fc7 "clamp_548fc7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %13 = OpConstantNull %v3uint + %17 = OpConstantNull %v3uint %_ptr_Function_v3uint = OpTypePointer Function %v3uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_548fc7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3uint Function %13 - %9 = OpExtInst %v3uint %12 UClamp %13 %13 %13 - OpStore %res %9 +%clamp_548fc7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %17 + %13 = OpExtInst %v3uint %16 UClamp %17 %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_548fc7 + %27 = OpFunctionCall %void %clamp_548fc7 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_548fc7 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_548fc7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_548fc7 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_548fc7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl index 0a5ebca187..363955925b 100644 --- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_548fc7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_548fc7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl index 3f832c6a6e..0e8878267d 100644 --- a/test/intrinsics/gen/clamp/5f0819.wgsl +++ b/test/intrinsics/gen/clamp/5f0819.wgsl @@ -27,8 +27,9 @@ fn clamp_5f0819() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_5f0819(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl index 4c53393f18..402bbab058 100644 --- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_5f0819() { int3 res = clamp(int3(0, 0, 0), int3(0, 0, 0), int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_5f0819(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl index 758dfaf4f7..5a6317d5d7 100644 --- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_5f0819() { int3 res = clamp(int3(), int3(), int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_5f0819(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm index 4d75c73da6..06500aa6f7 100644 --- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_5f0819 "clamp_5f0819" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %13 = OpConstantNull %v3int + %17 = OpConstantNull %v3int %_ptr_Function_v3int = OpTypePointer Function %v3int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_5f0819 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %13 - %9 = OpExtInst %v3int %12 SClamp %13 %13 %13 - OpStore %res %9 +%clamp_5f0819 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %17 + %13 = OpExtInst %v3int %16 SClamp %17 %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_5f0819 + %27 = OpFunctionCall %void %clamp_5f0819 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_5f0819 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_5f0819 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_5f0819 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_5f0819 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl index 5490dffe7c..9316046427 100644 --- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_5f0819() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_5f0819(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl index 50c6ecb103..25c8a4f568 100644 --- a/test/intrinsics/gen/clamp/6c1749.wgsl +++ b/test/intrinsics/gen/clamp/6c1749.wgsl @@ -27,8 +27,9 @@ fn clamp_6c1749() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_6c1749(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl index df7017785c..19fa7553fc 100644 --- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_6c1749() { int2 res = clamp(int2(0, 0), int2(0, 0), int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_6c1749(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl index 34397b698c..654a545a37 100644 --- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_6c1749() { int2 res = clamp(int2(), int2(), int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_6c1749(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm index 892edafa11..eac88250c2 100644 --- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_6c1749 "clamp_6c1749" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %13 = OpConstantNull %v2int + %17 = OpConstantNull %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_6c1749 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %13 - %9 = OpExtInst %v2int %12 SClamp %13 %13 %13 - OpStore %res %9 +%clamp_6c1749 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %17 + %13 = OpExtInst %v2int %16 SClamp %17 %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_6c1749 + %27 = OpFunctionCall %void %clamp_6c1749 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_6c1749 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_6c1749 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_6c1749 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_6c1749 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl index bc424ecc91..39d43ebb1f 100644 --- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_6c1749() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_6c1749(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl index 20b0214947..ac7eb5d36e 100644 --- a/test/intrinsics/gen/clamp/7706d7.wgsl +++ b/test/intrinsics/gen/clamp/7706d7.wgsl @@ -27,8 +27,9 @@ fn clamp_7706d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_7706d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl index ac8e422919..48fa122bb5 100644 --- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_7706d7() { uint2 res = clamp(uint2(0u, 0u), uint2(0u, 0u), uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_7706d7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl index 4faae26326..634bdf5bd5 100644 --- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_7706d7() { uint2 res = clamp(uint2(), uint2(), uint2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_7706d7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm index 5ecc8de93c..df66b69ae6 100644 --- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_7706d7 "clamp_7706d7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %13 = OpConstantNull %v2uint + %17 = OpConstantNull %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_7706d7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2uint Function %13 - %9 = OpExtInst %v2uint %12 UClamp %13 %13 %13 - OpStore %res %9 +%clamp_7706d7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %17 + %13 = OpExtInst %v2uint %16 UClamp %17 %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_7706d7 + %27 = OpFunctionCall %void %clamp_7706d7 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_7706d7 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_7706d7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_7706d7 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_7706d7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl index 76996d8143..433ed74d39 100644 --- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_7706d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_7706d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/867397.wgsl b/test/intrinsics/gen/clamp/867397.wgsl index 51dbf3ab08..4bde313f59 100644 --- a/test/intrinsics/gen/clamp/867397.wgsl +++ b/test/intrinsics/gen/clamp/867397.wgsl @@ -27,8 +27,9 @@ fn clamp_867397() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_867397(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl index fb3b131b9c..e7b719fae9 100644 --- a/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_867397() { float3 res = clamp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_867397(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl index a3647ecf07..6c8eeef453 100644 --- a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_867397() { float3 res = clamp(float3(), float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_867397(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm index f635487891..d0a9730b32 100644 --- a/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_867397 "clamp_867397" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_867397 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 NClamp %12 %12 %12 - OpStore %res %9 +%clamp_867397 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 NClamp %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %clamp_867397 + %26 = OpFunctionCall %void %clamp_867397 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %clamp_867397 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %clamp_867397 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %clamp_867397 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %clamp_867397 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl index ee22ec7167..bec2952b00 100644 --- a/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_867397() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_867397(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl index 57398aeb78..731c9dddc9 100644 --- a/test/intrinsics/gen/clamp/a2de25.wgsl +++ b/test/intrinsics/gen/clamp/a2de25.wgsl @@ -27,8 +27,9 @@ fn clamp_a2de25() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_a2de25(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl index d051684212..382350e480 100644 --- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_a2de25() { uint res = clamp(1u, 1u, 1u); } -void vertex_main() { +tint_symbol vertex_main() { clamp_a2de25(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl index 723dcceed3..00bbc2ac35 100644 --- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_a2de25() { uint res = clamp(1u, 1u, 1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_a2de25(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm index 1e40fa932c..5c38de7f3f 100644 --- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_a2de25 "clamp_a2de25" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_uint = OpTypePointer Function %uint - %15 = OpConstantNull %uint + %19 = OpConstantNull %uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_a2de25 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %15 - %9 = OpExtInst %uint %11 UClamp %uint_1 %uint_1 %uint_1 - OpStore %res %9 +%clamp_a2de25 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %19 + %13 = OpExtInst %uint %15 UClamp %uint_1 %uint_1 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_a2de25 + %27 = OpFunctionCall %void %clamp_a2de25 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_a2de25 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_a2de25 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_a2de25 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_a2de25 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl index dcc288b402..235c5bfb3a 100644 --- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_a2de25() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_a2de25(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl index 26037c0421..76be61bdb6 100644 --- a/test/intrinsics/gen/clamp/b07c65.wgsl +++ b/test/intrinsics/gen/clamp/b07c65.wgsl @@ -27,8 +27,9 @@ fn clamp_b07c65() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_b07c65(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl index 1e0f3b794a..4c2a7a42db 100644 --- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_b07c65() { int res = clamp(1, 1, 1); } -void vertex_main() { +tint_symbol vertex_main() { clamp_b07c65(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl index 66c5ed1496..15d67e6f22 100644 --- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_b07c65() { int res = clamp(1, 1, 1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_b07c65(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm index 766f94820a..ee9058330c 100644 --- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_b07c65 "clamp_b07c65" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_int = OpTypePointer Function %int - %15 = OpConstantNull %int + %19 = OpConstantNull %int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_b07c65 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_int Function %15 - %9 = OpExtInst %int %11 SClamp %int_1 %int_1 %int_1 - OpStore %res %9 +%clamp_b07c65 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %13 = OpExtInst %int %15 SClamp %int_1 %int_1 %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_b07c65 + %27 = OpFunctionCall %void %clamp_b07c65 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_b07c65 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_b07c65 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_b07c65 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_b07c65 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl index dcb8defd2e..452fecabfe 100644 --- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_b07c65() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_b07c65(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl index 312f5a40bf..90448ff212 100644 --- a/test/intrinsics/gen/clamp/bd43ce.wgsl +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl @@ -27,8 +27,9 @@ fn clamp_bd43ce() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_bd43ce(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl index aff6b0a401..939b0e30cb 100644 --- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void clamp_bd43ce() { uint4 res = clamp(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { clamp_bd43ce(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl index 635750321d..7e2562c01c 100644 --- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void clamp_bd43ce() { uint4 res = clamp(uint4(), uint4(), uint4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { clamp_bd43ce(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm index 2d2fc1ffe7..97c3f81187 100644 --- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %clamp_bd43ce "clamp_bd43ce" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %13 = OpConstantNull %v4uint + %17 = OpConstantNull %v4uint %_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%clamp_bd43ce = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %13 - %9 = OpExtInst %v4uint %12 UClamp %13 %13 %13 - OpStore %res %9 +%clamp_bd43ce = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %17 + %13 = OpExtInst %v4uint %16 UClamp %17 %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %clamp_bd43ce + %27 = OpFunctionCall %void %clamp_bd43ce + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %clamp_bd43ce +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %clamp_bd43ce OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %clamp_bd43ce +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %clamp_bd43ce OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl index 83486f023d..a36db41916 100644 --- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn clamp_bd43ce() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { clamp_bd43ce(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/16dc15.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl index 3be644c484..8c8563d51b 100644 --- a/test/intrinsics/gen/cos/16dc15.wgsl +++ b/test/intrinsics/gen/cos/16dc15.wgsl @@ -27,8 +27,9 @@ fn cos_16dc15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_16dc15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl index a7f13151c2..a13cac7688 100644 --- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cos_16dc15() { float3 res = cos(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cos_16dc15(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl index f82f797654..4aeac90625 100644 --- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cos_16dc15() { float3 res = cos(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cos_16dc15(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm index e9373f8efb..82fe4b01b0 100644 --- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cos_16dc15 "cos_16dc15" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %cos_16dc15 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Cos %12 - OpStore %res %9 + %cos_16dc15 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Cos %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cos_16dc15 + %26 = OpFunctionCall %void %cos_16dc15 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %cos_16dc15 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %cos_16dc15 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %cos_16dc15 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %cos_16dc15 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl index 556d991e02..606aa66714 100644 --- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cos_16dc15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_16dc15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/29d66d.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl index ac2ac10a23..d64c845b33 100644 --- a/test/intrinsics/gen/cos/29d66d.wgsl +++ b/test/intrinsics/gen/cos/29d66d.wgsl @@ -27,8 +27,9 @@ fn cos_29d66d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_29d66d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl index 745c39dec7..15304cdb77 100644 --- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cos_29d66d() { float4 res = cos(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cos_29d66d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl index a434caba0f..9c74fa231c 100644 --- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cos_29d66d() { float4 res = cos(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cos_29d66d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm index b3064677a8..1db9643f60 100644 --- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cos_29d66d "cos_29d66d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %cos_29d66d = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Cos %12 - OpStore %res %9 + %cos_29d66d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Cos %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cos_29d66d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %cos_29d66d + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %cos_29d66d + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %cos_29d66d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %cos_29d66d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl index 1ae251cb23..7bfdb87a7e 100644 --- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cos_29d66d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_29d66d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/c3b486.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl index dd860bec11..3401020c12 100644 --- a/test/intrinsics/gen/cos/c3b486.wgsl +++ b/test/intrinsics/gen/cos/c3b486.wgsl @@ -27,8 +27,9 @@ fn cos_c3b486() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_c3b486(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl index 98a4176150..65bab6174f 100644 --- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cos_c3b486() { float2 res = cos(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cos_c3b486(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl index 2d82317859..fa7aafc8ec 100644 --- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cos_c3b486() { float2 res = cos(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cos_c3b486(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm index 14f77a8d12..32f5010552 100644 --- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cos_c3b486 "cos_c3b486" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %cos_c3b486 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Cos %12 - OpStore %res %9 + %cos_c3b486 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Cos %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cos_c3b486 + %26 = OpFunctionCall %void %cos_c3b486 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %cos_c3b486 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %cos_c3b486 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %cos_c3b486 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %cos_c3b486 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl index 2d585d6dda..806a503905 100644 --- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cos_c3b486() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_c3b486(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl index 33bc9f4d43..010875291c 100644 --- a/test/intrinsics/gen/cos/c5c28e.wgsl +++ b/test/intrinsics/gen/cos/c5c28e.wgsl @@ -27,8 +27,9 @@ fn cos_c5c28e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_c5c28e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl index fbd531bbe5..162b46d559 100644 --- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cos_c5c28e() { float res = cos(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { cos_c5c28e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl index 0f1eba6698..1650815c02 100644 --- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cos_c5c28e() { float res = cos(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cos_c5c28e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm index 1183128cdb..00a2e61a9a 100644 --- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cos_c5c28e "cos_c5c28e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %cos_c5c28e = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %cos_c5c28e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Cos %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Cos %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %cos_c5c28e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %cos_c5c28e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %cos_c5c28e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %cos_c5c28e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %cos_c5c28e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %cos_c5c28e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl index b4a0453cdf..a9170b854c 100644 --- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cos_c5c28e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cos_c5c28e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/377652.wgsl b/test/intrinsics/gen/cosh/377652.wgsl index c4e548e2bf..551803c31e 100644 --- a/test/intrinsics/gen/cosh/377652.wgsl +++ b/test/intrinsics/gen/cosh/377652.wgsl @@ -27,8 +27,9 @@ fn cosh_377652() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_377652(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl index 019f1f4932..3a7fac1eca 100644 --- a/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cosh_377652() { float3 res = cosh(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cosh_377652(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl index 0fe5e89afe..f52361fa32 100644 --- a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cosh_377652() { float3 res = cosh(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cosh_377652(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm index e007f05f0f..3a3dcec192 100644 --- a/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cosh_377652 "cosh_377652" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%cosh_377652 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Cosh %12 - OpStore %res %9 +%cosh_377652 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Cosh %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cosh_377652 + %26 = OpFunctionCall %void %cosh_377652 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %cosh_377652 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %cosh_377652 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %cosh_377652 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %cosh_377652 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl index 29fffea113..e2f0fec32d 100644 --- a/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cosh_377652() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_377652(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/c13756.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl index 8d6aced307..158c38ad4b 100644 --- a/test/intrinsics/gen/cosh/c13756.wgsl +++ b/test/intrinsics/gen/cosh/c13756.wgsl @@ -27,8 +27,9 @@ fn cosh_c13756() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_c13756(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl index 72480bef43..e69f55394a 100644 --- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cosh_c13756() { float2 res = cosh(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cosh_c13756(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl index 8d9d463119..7cf7bca17c 100644 --- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cosh_c13756() { float2 res = cosh(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cosh_c13756(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm index 75734514d3..e684a82a0f 100644 --- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cosh_c13756 "cosh_c13756" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%cosh_c13756 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Cosh %12 - OpStore %res %9 +%cosh_c13756 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Cosh %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cosh_c13756 + %26 = OpFunctionCall %void %cosh_c13756 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %cosh_c13756 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %cosh_c13756 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %cosh_c13756 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %cosh_c13756 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl index 688528bc8c..fff94ac9e9 100644 --- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cosh_c13756() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_c13756(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl index da5876c437..1af5147bd9 100644 --- a/test/intrinsics/gen/cosh/da92dd.wgsl +++ b/test/intrinsics/gen/cosh/da92dd.wgsl @@ -27,8 +27,9 @@ fn cosh_da92dd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_da92dd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl index 0452df9db3..4fbccb7ccc 100644 --- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cosh_da92dd() { float res = cosh(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { cosh_da92dd(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl index 1455bf76d3..88231f23ac 100644 --- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cosh_da92dd() { float res = cosh(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cosh_da92dd(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm index 3ff45d5072..d5a08ab488 100644 --- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cosh_da92dd "cosh_da92dd" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%cosh_da92dd = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%cosh_da92dd = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Cosh %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Cosh %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %cosh_da92dd - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %cosh_da92dd - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %cosh_da92dd + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %cosh_da92dd + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %cosh_da92dd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %cosh_da92dd OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl index b2c83f851e..9a692e0f02 100644 --- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cosh_da92dd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_da92dd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl index 39b3c46edf..63e4c5d56c 100644 --- a/test/intrinsics/gen/cosh/e0c1de.wgsl +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl @@ -27,8 +27,9 @@ fn cosh_e0c1de() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_e0c1de(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl index 02e0258d4d..6cca3f0830 100644 --- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cosh_e0c1de() { float4 res = cosh(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cosh_e0c1de(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl index aaf2735e8a..9bc5d43d4a 100644 --- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cosh_e0c1de() { float4 res = cosh(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cosh_e0c1de(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm index 17ecea6114..7c4a94e6c9 100644 --- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cosh_e0c1de "cosh_e0c1de" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%cosh_e0c1de = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Cosh %12 - OpStore %res %9 +%cosh_e0c1de = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Cosh %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cosh_e0c1de - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %cosh_e0c1de + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %cosh_e0c1de + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %cosh_e0c1de + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %cosh_e0c1de OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl index bb74a3776b..a7c9b7b2dc 100644 --- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cosh_e0c1de() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cosh_e0c1de(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl index 7dc18e7832..a7376b8c67 100644 --- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl @@ -27,8 +27,9 @@ fn countOneBits_0d0e46() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_0d0e46(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl index dcb86cdf59..3ecd142803 100644 --- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_0d0e46() { uint4 res = countbits(uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_0d0e46(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl index 54b1390c31..c08490e8f4 100644 --- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_0d0e46() { uint4 res = popcount(uint4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_0d0e46(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm index e17d9f3254..f55307b57e 100644 --- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_0d0e46 "countOneBits_0d0e46" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %12 = OpConstantNull %v4uint + %16 = OpConstantNull %v4uint %_ptr_Function_v4uint = OpTypePointer Function %v4uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_0d0e46 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %12 - %9 = OpBitCount %v4uint %12 - OpStore %res %9 +%countOneBits_0d0e46 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %16 + %13 = OpBitCount %v4uint %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_0d0e46 + %26 = OpFunctionCall %void %countOneBits_0d0e46 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_0d0e46 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_0d0e46 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_0d0e46 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_0d0e46 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl index 561970b88a..bd1ed4f70a 100644 --- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_0d0e46() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_0d0e46(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl index 6ffa27dbc7..0c916cde6a 100644 --- a/test/intrinsics/gen/countOneBits/0f7980.wgsl +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl @@ -27,8 +27,9 @@ fn countOneBits_0f7980() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_0f7980(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl index 1c0cab492c..0b46abbc84 100644 --- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_0f7980() { int4 res = countbits(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_0f7980(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl index 2f2970783a..25b509df6b 100644 --- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_0f7980() { int4 res = popcount(int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_0f7980(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm index e20c852fb1..753cbc877f 100644 --- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_0f7980 "countOneBits_0f7980" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %12 = OpConstantNull %v4int + %16 = OpConstantNull %v4int %_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_0f7980 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %12 - %9 = OpBitCount %v4int %12 - OpStore %res %9 +%countOneBits_0f7980 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %16 + %13 = OpBitCount %v4int %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_0f7980 + %26 = OpFunctionCall %void %countOneBits_0f7980 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_0f7980 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_0f7980 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_0f7980 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_0f7980 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl index 79e258292c..4daefd4176 100644 --- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_0f7980() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_0f7980(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl index 3c07f8acd7..1ec21929ad 100644 --- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl @@ -27,8 +27,9 @@ fn countOneBits_65d2ae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_65d2ae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl index 1158671f0f..f45af04dbb 100644 --- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_65d2ae() { int3 res = countbits(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_65d2ae(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl index 1cf0ffd232..aad3dd4d0d 100644 --- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_65d2ae() { int3 res = popcount(int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_65d2ae(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm index 57a52f386e..165393b9ec 100644 --- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_65d2ae "countOneBits_65d2ae" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %12 = OpConstantNull %v3int + %16 = OpConstantNull %v3int %_ptr_Function_v3int = OpTypePointer Function %v3int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_65d2ae = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %12 - %9 = OpBitCount %v3int %12 - OpStore %res %9 +%countOneBits_65d2ae = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %16 + %13 = OpBitCount %v3int %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_65d2ae + %26 = OpFunctionCall %void %countOneBits_65d2ae + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_65d2ae +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_65d2ae OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_65d2ae +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_65d2ae OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl index 209dc7a87c..90ba75a776 100644 --- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_65d2ae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_65d2ae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl index f96143b2fa..136459e12b 100644 --- a/test/intrinsics/gen/countOneBits/690cfc.wgsl +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl @@ -27,8 +27,9 @@ fn countOneBits_690cfc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_690cfc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl index be66422f12..e39e491cb2 100644 --- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_690cfc() { uint3 res = countbits(uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_690cfc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl index fe38cf575a..1ead1f95d7 100644 --- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_690cfc() { uint3 res = popcount(uint3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_690cfc(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm index 011e90326b..c11d998c83 100644 --- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_690cfc "countOneBits_690cfc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %12 = OpConstantNull %v3uint + %16 = OpConstantNull %v3uint %_ptr_Function_v3uint = OpTypePointer Function %v3uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_690cfc = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3uint Function %12 - %9 = OpBitCount %v3uint %12 - OpStore %res %9 +%countOneBits_690cfc = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %16 + %13 = OpBitCount %v3uint %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_690cfc + %26 = OpFunctionCall %void %countOneBits_690cfc + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_690cfc +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_690cfc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_690cfc +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_690cfc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl index 3ac5ddb445..7e005f808d 100644 --- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_690cfc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_690cfc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl index 368f3ea3c8..0ce0bc3343 100644 --- a/test/intrinsics/gen/countOneBits/94fd81.wgsl +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl @@ -27,8 +27,9 @@ fn countOneBits_94fd81() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_94fd81(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl index 547cdadbc8..582f6c3d41 100644 --- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_94fd81() { uint2 res = countbits(uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_94fd81(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl index 8f12412e29..57d94f3f33 100644 --- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_94fd81() { uint2 res = popcount(uint2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_94fd81(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm index d3886508ef..c5dd42e961 100644 --- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_94fd81 "countOneBits_94fd81" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %12 = OpConstantNull %v2uint + %16 = OpConstantNull %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_94fd81 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2uint Function %12 - %9 = OpBitCount %v2uint %12 - OpStore %res %9 +%countOneBits_94fd81 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %16 + %13 = OpBitCount %v2uint %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_94fd81 + %26 = OpFunctionCall %void %countOneBits_94fd81 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_94fd81 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_94fd81 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_94fd81 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_94fd81 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl index 69fa22d55c..2490a95740 100644 --- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_94fd81() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_94fd81(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl index ab447cafe6..73791894d7 100644 --- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl @@ -27,8 +27,9 @@ fn countOneBits_ae44f9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_ae44f9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl index a9eebc6fde..95166f6164 100644 --- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_ae44f9() { uint res = countbits(1u); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_ae44f9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl index 4313675e1c..8626141ac4 100644 --- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_ae44f9() { uint res = popcount(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_ae44f9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm index 70edbdf1e8..20b438f362 100644 --- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_ae44f9 "countOneBits_ae44f9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_uint = OpTypePointer Function %uint - %14 = OpConstantNull %uint + %18 = OpConstantNull %uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_ae44f9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %14 - %9 = OpBitCount %uint %uint_1 - OpStore %res %9 +%countOneBits_ae44f9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %18 + %13 = OpBitCount %uint %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_ae44f9 + %26 = OpFunctionCall %void %countOneBits_ae44f9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_ae44f9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_ae44f9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_ae44f9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_ae44f9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl index 323ceab08b..2d6fcb2731 100644 --- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_ae44f9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_ae44f9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl index d6afd811b3..4eb7663a39 100644 --- a/test/intrinsics/gen/countOneBits/af90e2.wgsl +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl @@ -27,8 +27,9 @@ fn countOneBits_af90e2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_af90e2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl index a3c0bca90c..106a672e7b 100644 --- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_af90e2() { int2 res = countbits(int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_af90e2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl index 0c0e24b948..3aeaa26856 100644 --- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_af90e2() { int2 res = popcount(int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_af90e2(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm index 1f79a2a35b..8e7d7886ab 100644 --- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_af90e2 "countOneBits_af90e2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %12 = OpConstantNull %v2int + %16 = OpConstantNull %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_af90e2 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %12 - %9 = OpBitCount %v2int %12 - OpStore %res %9 +%countOneBits_af90e2 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %16 + %13 = OpBitCount %v2int %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_af90e2 + %26 = OpFunctionCall %void %countOneBits_af90e2 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_af90e2 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_af90e2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_af90e2 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_af90e2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl index 1f7759dc58..73f1efe9e5 100644 --- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_af90e2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_af90e2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl index c271a37c9d..e7deb25570 100644 --- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl @@ -27,8 +27,9 @@ fn countOneBits_fd88b2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_fd88b2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl index be5f7782de..91cbb87983 100644 --- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void countOneBits_fd88b2() { int res = countbits(1); } -void vertex_main() { +tint_symbol vertex_main() { countOneBits_fd88b2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl index 87cbb5c4b5..7002fce368 100644 --- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void countOneBits_fd88b2() { int res = popcount(1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { countOneBits_fd88b2(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm index 32fdbfe346..00309525a9 100644 --- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %countOneBits_fd88b2 "countOneBits_fd88b2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_int = OpTypePointer Function %int - %14 = OpConstantNull %int + %18 = OpConstantNull %int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%countOneBits_fd88b2 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_int Function %14 - %9 = OpBitCount %int %int_1 - OpStore %res %9 +%countOneBits_fd88b2 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %13 = OpBitCount %int %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %countOneBits_fd88b2 + %26 = OpFunctionCall %void %countOneBits_fd88b2 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %countOneBits_fd88b2 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %countOneBits_fd88b2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %countOneBits_fd88b2 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %countOneBits_fd88b2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl index 9e6e9e80e1..8f0dbd0dba 100644 --- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn countOneBits_fd88b2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { countOneBits_fd88b2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cross/041cb0.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl index e2f5ddd424..622c133b56 100644 --- a/test/intrinsics/gen/cross/041cb0.wgsl +++ b/test/intrinsics/gen/cross/041cb0.wgsl @@ -27,8 +27,9 @@ fn cross_041cb0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cross_041cb0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl index 59be0e9f70..0e27cd5e0c 100644 --- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void cross_041cb0() { float3 res = cross(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { cross_041cb0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl index fc8f3119f1..a70d5f1578 100644 --- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void cross_041cb0() { float3 res = cross(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { cross_041cb0(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm index e14592e1ba..148a980a71 100644 --- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %cross_041cb0 "cross_041cb0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%cross_041cb0 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Cross %12 %12 - OpStore %res %9 +%cross_041cb0 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Cross %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %cross_041cb0 + %26 = OpFunctionCall %void %cross_041cb0 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %cross_041cb0 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %cross_041cb0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %cross_041cb0 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %cross_041cb0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl index ef4b20ff29..9016e2821e 100644 --- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn cross_041cb0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { cross_041cb0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl index 1b4b85defb..3696f0108a 100644 --- a/test/intrinsics/gen/determinant/2b62ba.wgsl +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl @@ -27,8 +27,9 @@ fn determinant_2b62ba() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { determinant_2b62ba(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl index 45e0cf8829..faf8357773 100644 --- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void determinant_2b62ba() { float res = determinant(float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { determinant_2b62ba(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl index 22bfd581bc..d3fd820b1a 100644 --- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void determinant_2b62ba() { float res = determinant(float3x3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { determinant_2b62ba(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm index 763032a7fa..1b4b47f712 100644 --- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %determinant_2b62ba "determinant_2b62ba" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 %mat3v3float = OpTypeMatrix %v3float 3 - %13 = OpConstantNull %mat3v3float + %17 = OpConstantNull %mat3v3float %_ptr_Function_float = OpTypePointer Function %float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%determinant_2b62ba = OpFunction %void None %5 - %8 = OpLabel +%determinant_2b62ba = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Determinant %13 - OpStore %res %9 + %13 = OpExtInst %float %14 Determinant %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %determinant_2b62ba + %27 = OpFunctionCall %void %determinant_2b62ba + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %determinant_2b62ba +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %determinant_2b62ba OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %determinant_2b62ba +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %determinant_2b62ba OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl index 0c79f281ae..5878b38e17 100644 --- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn determinant_2b62ba() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { determinant_2b62ba(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl index d4d4a1164e..050612545b 100644 --- a/test/intrinsics/gen/determinant/a0a87c.wgsl +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl @@ -27,8 +27,9 @@ fn determinant_a0a87c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { determinant_a0a87c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl index 83bb75133c..f09194692f 100644 --- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void determinant_a0a87c() { float res = determinant(float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { determinant_a0a87c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl index 0d17e9c4a6..c53e2bd017 100644 --- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void determinant_a0a87c() { float res = determinant(float4x4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { determinant_a0a87c(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm index 44b6875a1d..60df6442e9 100644 --- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm @@ -1,54 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %determinant_a0a87c "determinant_a0a87c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %mat4v4float = OpTypeMatrix %v4float 4 - %13 = OpConstantNull %mat4v4float + %16 = OpConstantNull %mat4v4float %_ptr_Function_float = OpTypePointer Function %float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%determinant_a0a87c = OpFunction %void None %5 - %8 = OpLabel +%determinant_a0a87c = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Determinant %13 - OpStore %res %9 + %13 = OpExtInst %float %14 Determinant %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel - OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %determinant_a0a87c +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %determinant_a0a87c - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%vertex_main = OpFunction %void None %9 %24 = OpLabel - %25 = OpFunctionCall %void %determinant_a0a87c + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %determinant_a0a87c + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %determinant_a0a87c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %determinant_a0a87c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl index 402650feea..394babb1eb 100644 --- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn determinant_a0a87c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { determinant_a0a87c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/determinant/e19305.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl index 96a1fe0aa1..02121e293f 100644 --- a/test/intrinsics/gen/determinant/e19305.wgsl +++ b/test/intrinsics/gen/determinant/e19305.wgsl @@ -27,8 +27,9 @@ fn determinant_e19305() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { determinant_e19305(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl index 90295a3bdf..9159fdbaed 100644 --- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void determinant_e19305() { float res = determinant(float2x2(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { determinant_e19305(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl index 22919d40ed..025f8713f5 100644 --- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void determinant_e19305() { float res = determinant(float2x2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { determinant_e19305(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm index 80a1dedfcc..2ce7c327a8 100644 --- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %determinant_e19305 "determinant_e19305" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 %mat2v2float = OpTypeMatrix %v2float 2 - %13 = OpConstantNull %mat2v2float + %17 = OpConstantNull %mat2v2float %_ptr_Function_float = OpTypePointer Function %float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%determinant_e19305 = OpFunction %void None %5 - %8 = OpLabel +%determinant_e19305 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Determinant %13 - OpStore %res %9 + %13 = OpExtInst %float %14 Determinant %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %determinant_e19305 + %27 = OpFunctionCall %void %determinant_e19305 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %determinant_e19305 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %determinant_e19305 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %determinant_e19305 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %determinant_e19305 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl index f5cbf338f2..63be531bac 100644 --- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn determinant_e19305() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { determinant_e19305(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/0657d4.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl index 065497d4ca..fdcb772bb6 100644 --- a/test/intrinsics/gen/distance/0657d4.wgsl +++ b/test/intrinsics/gen/distance/0657d4.wgsl @@ -27,8 +27,9 @@ fn distance_0657d4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_0657d4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl index 3237591c55..24476aeff4 100644 --- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void distance_0657d4() { float res = distance(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { distance_0657d4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl index 5281fa5d9a..a1f835fdb0 100644 --- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void distance_0657d4() { float res = distance(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { distance_0657d4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm index 510e6bbea7..7ed1ee62fe 100644 --- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %distance_0657d4 "distance_0657d4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_float = OpTypePointer Function %float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%distance_0657d4 = OpFunction %void None %5 - %8 = OpLabel +%distance_0657d4 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Distance %12 %12 - OpStore %res %9 + %13 = OpExtInst %float %14 Distance %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %distance_0657d4 + %26 = OpFunctionCall %void %distance_0657d4 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %distance_0657d4 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %distance_0657d4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %distance_0657d4 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %distance_0657d4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl index 314378f54c..fdc55c0d06 100644 --- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn distance_0657d4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_0657d4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/9646ea.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl index 9f4e7b19dd..95170834fb 100644 --- a/test/intrinsics/gen/distance/9646ea.wgsl +++ b/test/intrinsics/gen/distance/9646ea.wgsl @@ -27,8 +27,9 @@ fn distance_9646ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_9646ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl index f87319508d..ee8464782a 100644 --- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void distance_9646ea() { float res = distance(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { distance_9646ea(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl index 32611cda49..6b6b77e70e 100644 --- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void distance_9646ea() { float res = distance(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { distance_9646ea(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm index d034af57aa..b8c7fa76da 100644 --- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %distance_9646ea "distance_9646ea" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_float = OpTypePointer Function %float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%distance_9646ea = OpFunction %void None %5 - %8 = OpLabel +%distance_9646ea = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Distance %12 %12 - OpStore %res %9 + %13 = OpExtInst %float %14 Distance %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %distance_9646ea - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %distance_9646ea + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %distance_9646ea + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %distance_9646ea + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %distance_9646ea OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl index 39fe3d23a4..24ca425410 100644 --- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn distance_9646ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_9646ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/aa4055.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl index 8e8387a245..5c208bbb04 100644 --- a/test/intrinsics/gen/distance/aa4055.wgsl +++ b/test/intrinsics/gen/distance/aa4055.wgsl @@ -27,8 +27,9 @@ fn distance_aa4055() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_aa4055(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl index 3f7e5a8666..d23ef597a6 100644 --- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void distance_aa4055() { float res = distance(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { distance_aa4055(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl index 5f2f493c41..bf66f8e384 100644 --- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void distance_aa4055() { float res = distance(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { distance_aa4055(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm index 52ff97c5a4..48e1a45e52 100644 --- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %distance_aa4055 "distance_aa4055" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_float = OpTypePointer Function %float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%distance_aa4055 = OpFunction %void None %5 - %8 = OpLabel +%distance_aa4055 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Distance %12 %12 - OpStore %res %9 + %13 = OpExtInst %float %14 Distance %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %distance_aa4055 + %26 = OpFunctionCall %void %distance_aa4055 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %distance_aa4055 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %distance_aa4055 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %distance_aa4055 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %distance_aa4055 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl index f6f6826461..8f8ad243e7 100644 --- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn distance_aa4055() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_aa4055(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/cfed73.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl index 5fe662a56d..138bcc5275 100644 --- a/test/intrinsics/gen/distance/cfed73.wgsl +++ b/test/intrinsics/gen/distance/cfed73.wgsl @@ -27,8 +27,9 @@ fn distance_cfed73() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_cfed73(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl index 7a90d5402f..82c8668993 100644 --- a/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void distance_cfed73() { float res = distance(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { distance_cfed73(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm index 29c44fb760..8a87deebcd 100644 --- a/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %distance_cfed73 "distance_cfed73" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%distance_cfed73 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%distance_cfed73 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Distance %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Distance %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %distance_cfed73 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %distance_cfed73 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %distance_cfed73 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %distance_cfed73 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %distance_cfed73 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %distance_cfed73 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl index ff76b9d7cc..4a519beb38 100644 --- a/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn distance_cfed73() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { distance_cfed73(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/dot/0c577b.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl index 7d32e31549..faf956a2f4 100644 --- a/test/intrinsics/gen/dot/0c577b.wgsl +++ b/test/intrinsics/gen/dot/0c577b.wgsl @@ -27,8 +27,9 @@ fn dot_0c577b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { dot_0c577b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl index 2736edd301..3da6b9529c 100644 --- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void dot_0c577b() { float res = dot(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { dot_0c577b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl index 3758c7f562..4ed24198b4 100644 --- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void dot_0c577b() { float res = dot(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { dot_0c577b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm index 37383ec6af..a56518ccde 100644 --- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm @@ -1,52 +1,66 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 24 +; Bound: 31 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %dot_0c577b "dot_0c577b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %11 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_float = OpTypePointer Function %float + %16 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %dot_0c577b = OpFunction %void None %5 - %8 = OpLabel + %dot_0c577b = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpDot %float %11 %11 - OpStore %res %9 + %13 = OpDot %float %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %17 = OpFunctionCall %void %dot_0c577b - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %16 +%tint_symbol = OpFunctionParameter %v4float %19 = OpLabel - %20 = OpFunctionCall %void %dot_0c577b + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %22 = OpLabel +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 %23 = OpFunctionCall %void %dot_0c577b + %24 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %dot_0c577b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %dot_0c577b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl index 09912d6b7d..eeb08cd8b0 100644 --- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn dot_0c577b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { dot_0c577b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/dot/883f0e.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl index 74c9ab77fd..31eaa26b47 100644 --- a/test/intrinsics/gen/dot/883f0e.wgsl +++ b/test/intrinsics/gen/dot/883f0e.wgsl @@ -27,8 +27,9 @@ fn dot_883f0e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { dot_883f0e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl index c72475a4cb..4d5aa8dde9 100644 --- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void dot_883f0e() { float res = dot(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { dot_883f0e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl index 260fee30e4..4326cadf7d 100644 --- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void dot_883f0e() { float res = dot(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { dot_883f0e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm index 7f313bfb0d..f6a6f4f131 100644 --- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm @@ -1,52 +1,68 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 24 +; Bound: 33 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %dot_883f0e "dot_883f0e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %11 = OpConstantNull %v2float + %15 = OpConstantNull %v2float %_ptr_Function_float = OpTypePointer Function %float + %18 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %dot_883f0e = OpFunction %void None %5 - %8 = OpLabel + %dot_883f0e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpDot %float %11 %11 - OpStore %res %9 + %13 = OpDot %float %15 %15 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float + %21 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel OpStore %tint_pointsize %float_1 - %17 = OpFunctionCall %void %dot_883f0e + %25 = OpFunctionCall %void %dot_883f0e + %26 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %19 = OpLabel - %20 = OpFunctionCall %void %dot_883f0e +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %dot_883f0e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %dot_883f0e +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %dot_883f0e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl index e0cfc7344d..77123798c3 100644 --- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn dot_883f0e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { dot_883f0e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/dot/ba4246.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl index 11776b9acd..87e72fa713 100644 --- a/test/intrinsics/gen/dot/ba4246.wgsl +++ b/test/intrinsics/gen/dot/ba4246.wgsl @@ -27,8 +27,9 @@ fn dot_ba4246() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { dot_ba4246(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl index aa91fe7b4e..8498c90bcf 100644 --- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void dot_ba4246() { float res = dot(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { dot_ba4246(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl index 521557f3ac..ff18b2d89b 100644 --- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void dot_ba4246() { float res = dot(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { dot_ba4246(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm index 613cb9255c..d522c0b389 100644 --- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm @@ -1,52 +1,68 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 24 +; Bound: 33 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %dot_ba4246 "dot_ba4246" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %11 = OpConstantNull %v3float + %15 = OpConstantNull %v3float %_ptr_Function_float = OpTypePointer Function %float + %18 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %dot_ba4246 = OpFunction %void None %5 - %8 = OpLabel + %dot_ba4246 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpDot %float %11 %11 - OpStore %res %9 + %13 = OpDot %float %15 %15 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float + %21 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel OpStore %tint_pointsize %float_1 - %17 = OpFunctionCall %void %dot_ba4246 + %25 = OpFunctionCall %void %dot_ba4246 + %26 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %19 = OpLabel - %20 = OpFunctionCall %void %dot_ba4246 +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %dot_ba4246 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %dot_ba4246 +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %dot_ba4246 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl index a17c295fd5..ad9f415468 100644 --- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn dot_ba4246() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { dot_ba4246(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl index a5de8fe5e2..3447d81021 100644 --- a/test/intrinsics/gen/exp/0f70eb.wgsl +++ b/test/intrinsics/gen/exp/0f70eb.wgsl @@ -27,8 +27,9 @@ fn exp_0f70eb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_0f70eb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl index 2739620f7c..d9e0f371f3 100644 --- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp_0f70eb() { float4 res = exp(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { exp_0f70eb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl index f019d60e59..53549b7ad0 100644 --- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp_0f70eb() { float4 res = exp(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp_0f70eb(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm index f331531082..e82f0595d8 100644 --- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp_0f70eb "exp_0f70eb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %exp_0f70eb = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Exp %12 - OpStore %res %9 + %exp_0f70eb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Exp %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %exp_0f70eb - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %exp_0f70eb + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %exp_0f70eb + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %exp_0f70eb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %exp_0f70eb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl index fcd1bf3143..157d0eae20 100644 --- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp_0f70eb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_0f70eb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/1951e7.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl index 4377980166..acd4e660a5 100644 --- a/test/intrinsics/gen/exp/1951e7.wgsl +++ b/test/intrinsics/gen/exp/1951e7.wgsl @@ -27,8 +27,9 @@ fn exp_1951e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_1951e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl index a58d3e9e5e..d0804497a8 100644 --- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp_1951e7() { float2 res = exp(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { exp_1951e7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl index 298ce08cca..726f80d7e6 100644 --- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp_1951e7() { float2 res = exp(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp_1951e7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm index 61f4ab3430..5439298672 100644 --- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp_1951e7 "exp_1951e7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %exp_1951e7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Exp %12 - OpStore %res %9 + %exp_1951e7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Exp %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %exp_1951e7 + %26 = OpFunctionCall %void %exp_1951e7 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %exp_1951e7 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %exp_1951e7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %exp_1951e7 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %exp_1951e7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl index 345795124f..618eb2cf61 100644 --- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp_1951e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_1951e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/771fd2.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl index 6138fb48c3..6c73d3593b 100644 --- a/test/intrinsics/gen/exp/771fd2.wgsl +++ b/test/intrinsics/gen/exp/771fd2.wgsl @@ -27,8 +27,9 @@ fn exp_771fd2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_771fd2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl index 8c34c09951..d6259fe215 100644 --- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp_771fd2() { float res = exp(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { exp_771fd2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl index 17e6c84619..0a161db50c 100644 --- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp_771fd2() { float res = exp(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp_771fd2(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm index cbfdf1cd5b..5100cd0275 100644 --- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp_771fd2 "exp_771fd2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %exp_771fd2 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %exp_771fd2 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Exp %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Exp %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %exp_771fd2 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %exp_771fd2 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %exp_771fd2 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %exp_771fd2 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %exp_771fd2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %exp_771fd2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl index ca36b2c8e4..6034699e56 100644 --- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp_771fd2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_771fd2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/d98450.wgsl b/test/intrinsics/gen/exp/d98450.wgsl index 754d43a4d3..078a208e8f 100644 --- a/test/intrinsics/gen/exp/d98450.wgsl +++ b/test/intrinsics/gen/exp/d98450.wgsl @@ -27,8 +27,9 @@ fn exp_d98450() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_d98450(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl index 1587672746..d9ed452b3b 100644 --- a/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp_d98450() { float3 res = exp(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { exp_d98450(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl index 7e0df49deb..1ec8727331 100644 --- a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp_d98450() { float3 res = exp(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp_d98450(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm index 45cdde144a..448017c5c7 100644 --- a/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp_d98450 "exp_d98450" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %exp_d98450 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Exp %12 - OpStore %res %9 + %exp_d98450 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Exp %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %exp_d98450 + %26 = OpFunctionCall %void %exp_d98450 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %exp_d98450 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %exp_d98450 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %exp_d98450 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %exp_d98450 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl index 342316909e..332a46253b 100644 --- a/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp_d98450() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp_d98450(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl index ec8cb20f3d..91fead542d 100644 --- a/test/intrinsics/gen/exp2/1f8680.wgsl +++ b/test/intrinsics/gen/exp2/1f8680.wgsl @@ -27,8 +27,9 @@ fn exp2_1f8680() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_1f8680(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl index ca91ba5e57..5bc943f0ee 100644 --- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp2_1f8680() { float3 res = exp2(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { exp2_1f8680(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl index fb80ff795f..057b984aa8 100644 --- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp2_1f8680() { float3 res = exp2(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp2_1f8680(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm index 1b944c1103..6e672de2b7 100644 --- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp2_1f8680 "exp2_1f8680" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%exp2_1f8680 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Exp2 %12 - OpStore %res %9 +%exp2_1f8680 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Exp2 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %exp2_1f8680 + %26 = OpFunctionCall %void %exp2_1f8680 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %exp2_1f8680 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %exp2_1f8680 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %exp2_1f8680 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %exp2_1f8680 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl index 6d20071af8..a7bc4baba3 100644 --- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp2_1f8680() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_1f8680(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl index d5e4df5066..37cb66e2f5 100644 --- a/test/intrinsics/gen/exp2/a9d0a7.wgsl +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl @@ -27,8 +27,9 @@ fn exp2_a9d0a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_a9d0a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl index 6dfb8b8db7..9ddf6d900e 100644 --- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp2_a9d0a7() { float4 res = exp2(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { exp2_a9d0a7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl index f6114d4e58..ed2faacb88 100644 --- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp2_a9d0a7() { float4 res = exp2(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp2_a9d0a7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm index 6360aeadda..1193c23a44 100644 --- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp2_a9d0a7 "exp2_a9d0a7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%exp2_a9d0a7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Exp2 %12 - OpStore %res %9 +%exp2_a9d0a7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Exp2 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %exp2_a9d0a7 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %exp2_a9d0a7 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %exp2_a9d0a7 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %exp2_a9d0a7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %exp2_a9d0a7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl index 415b612987..4a2227afa6 100644 --- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp2_a9d0a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_a9d0a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl index 5e5cecb422..337db930e3 100644 --- a/test/intrinsics/gen/exp2/d6777c.wgsl +++ b/test/intrinsics/gen/exp2/d6777c.wgsl @@ -27,8 +27,9 @@ fn exp2_d6777c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_d6777c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl index 1a7cb5fe5a..5354c3c8e0 100644 --- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp2_d6777c() { float2 res = exp2(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { exp2_d6777c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl index 48a5a4616f..6149c4d5bd 100644 --- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp2_d6777c() { float2 res = exp2(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp2_d6777c(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm index 4667d68ba4..571bff023a 100644 --- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp2_d6777c "exp2_d6777c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%exp2_d6777c = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Exp2 %12 - OpStore %res %9 +%exp2_d6777c = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Exp2 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %exp2_d6777c + %26 = OpFunctionCall %void %exp2_d6777c + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %exp2_d6777c +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %exp2_d6777c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %exp2_d6777c +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %exp2_d6777c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl index 189d7becc4..9f32c1582c 100644 --- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp2_d6777c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_d6777c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/dea523.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl index 6c0391839a..a863fd9be2 100644 --- a/test/intrinsics/gen/exp2/dea523.wgsl +++ b/test/intrinsics/gen/exp2/dea523.wgsl @@ -27,8 +27,9 @@ fn exp2_dea523() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_dea523(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl index 8b75b70f94..8ceb49d675 100644 --- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void exp2_dea523() { float res = exp2(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { exp2_dea523(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl index d18c2ef783..491945c6f6 100644 --- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void exp2_dea523() { float res = exp2(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { exp2_dea523(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm index 9ae8c9882c..dbeb36194b 100644 --- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %exp2_dea523 "exp2_dea523" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%exp2_dea523 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%exp2_dea523 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Exp2 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Exp2 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %exp2_dea523 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %exp2_dea523 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %exp2_dea523 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %exp2_dea523 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %exp2_dea523 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %exp2_dea523 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl index 136bc62476..d6ca4f8ed4 100644 --- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn exp2_dea523() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { exp2_dea523(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl index e72c377ea3..7d5ce9db31 100644 --- a/test/intrinsics/gen/faceForward/5afbd5.wgsl +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl @@ -27,8 +27,9 @@ fn faceForward_5afbd5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_5afbd5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl index 9df71d6af5..c1705acf6f 100644 --- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void faceForward_5afbd5() { float3 res = faceforward(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { faceForward_5afbd5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl index 4a95173524..fcd07b6dc1 100644 --- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void faceForward_5afbd5() { float3 res = faceforward(float3(), float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { faceForward_5afbd5(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm index 90d4263977..6fc0f180ed 100644 --- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %faceForward_5afbd5 "faceForward_5afbd5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%faceForward_5afbd5 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 FaceForward %12 %12 %12 - OpStore %res %9 +%faceForward_5afbd5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 FaceForward %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %faceForward_5afbd5 + %26 = OpFunctionCall %void %faceForward_5afbd5 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %faceForward_5afbd5 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %faceForward_5afbd5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %faceForward_5afbd5 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %faceForward_5afbd5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl index 901d9f3b34..6f67502441 100644 --- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn faceForward_5afbd5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_5afbd5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl index fb7a156c3b..6a9c5cd309 100644 --- a/test/intrinsics/gen/faceForward/b316e5.wgsl +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl @@ -27,8 +27,9 @@ fn faceForward_b316e5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_b316e5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl index c02347c31c..ad2397caf7 100644 --- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void faceForward_b316e5() { float4 res = faceforward(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { faceForward_b316e5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl index 71972d7839..1048b00e83 100644 --- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void faceForward_b316e5() { float4 res = faceforward(float4(), float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { faceForward_b316e5(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm index 163e751ad1..07f0358c9d 100644 --- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %faceForward_b316e5 "faceForward_b316e5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%faceForward_b316e5 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 FaceForward %12 %12 %12 - OpStore %res %9 +%faceForward_b316e5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 FaceForward %8 %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %faceForward_b316e5 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %faceForward_b316e5 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %faceForward_b316e5 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %faceForward_b316e5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %faceForward_b316e5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl index 904f610330..b4b5130528 100644 --- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn faceForward_b316e5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_b316e5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl index deb3846408..618f90e130 100644 --- a/test/intrinsics/gen/faceForward/e6908b.wgsl +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl @@ -27,8 +27,9 @@ fn faceForward_e6908b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_e6908b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl index de0f89e956..1f4c927859 100644 --- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void faceForward_e6908b() { float2 res = faceforward(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { faceForward_e6908b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl index 2cfdf0e12e..ca8e6ef3b2 100644 --- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void faceForward_e6908b() { float2 res = faceforward(float2(), float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { faceForward_e6908b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm index 861015d522..8e98deed55 100644 --- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %faceForward_e6908b "faceForward_e6908b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%faceForward_e6908b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 FaceForward %12 %12 %12 - OpStore %res %9 +%faceForward_e6908b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 FaceForward %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %faceForward_e6908b + %26 = OpFunctionCall %void %faceForward_e6908b + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %faceForward_e6908b +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %faceForward_e6908b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %faceForward_e6908b +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %faceForward_e6908b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl index f232df2727..d371e9dcb7 100644 --- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn faceForward_e6908b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_e6908b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl index 0616792403..28724881da 100644 --- a/test/intrinsics/gen/faceForward/fc994b.wgsl +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl @@ -27,8 +27,9 @@ fn faceForward_fc994b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_fc994b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl index 88f13411f9..9516896f10 100644 --- a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void faceForward_fc994b() { float res = faceforward(1.0f, 1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { faceForward_fc994b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm index fc9853e057..17367a4d14 100644 --- a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %faceForward_fc994b "faceForward_fc994b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%faceForward_fc994b = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%faceForward_fc994b = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 FaceForward %float_1 %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 FaceForward %float_1 %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %faceForward_fc994b - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %faceForward_fc994b - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %faceForward_fc994b + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %faceForward_fc994b + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %faceForward_fc994b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %faceForward_fc994b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl index 3dc67f306d..903874afb0 100644 --- a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn faceForward_fc994b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { faceForward_fc994b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl index c5a4e525bd..c1a54d868a 100644 --- a/test/intrinsics/gen/floor/3bccc4.wgsl +++ b/test/intrinsics/gen/floor/3bccc4.wgsl @@ -27,8 +27,9 @@ fn floor_3bccc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_3bccc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl index 529d56ae78..4a90889358 100644 --- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void floor_3bccc4() { float4 res = floor(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { floor_3bccc4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl index 5b5e7e41a9..7802674e52 100644 --- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void floor_3bccc4() { float4 res = floor(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { floor_3bccc4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm index baf11b1f55..634a08a4ba 100644 --- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %floor_3bccc4 "floor_3bccc4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%floor_3bccc4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Floor %12 - OpStore %res %9 +%floor_3bccc4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Floor %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %floor_3bccc4 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %floor_3bccc4 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %floor_3bccc4 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %floor_3bccc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %floor_3bccc4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl index 574e6b13b7..aed6b00bf4 100644 --- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn floor_3bccc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_3bccc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl index 06d4b493e0..1d06253bea 100644 --- a/test/intrinsics/gen/floor/5fc9ac.wgsl +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl @@ -27,8 +27,9 @@ fn floor_5fc9ac() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_5fc9ac(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl index 241394d21e..dc36184c1b 100644 --- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void floor_5fc9ac() { float2 res = floor(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { floor_5fc9ac(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl index c337a9c82a..36b78f84ea 100644 --- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void floor_5fc9ac() { float2 res = floor(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { floor_5fc9ac(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm index 81c4d3b513..9d25150176 100644 --- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %floor_5fc9ac "floor_5fc9ac" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%floor_5fc9ac = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Floor %12 - OpStore %res %9 +%floor_5fc9ac = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Floor %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %floor_5fc9ac + %26 = OpFunctionCall %void %floor_5fc9ac + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %floor_5fc9ac +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %floor_5fc9ac OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %floor_5fc9ac +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %floor_5fc9ac OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl index 40d3dcbc13..604a9a877e 100644 --- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn floor_5fc9ac() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_5fc9ac(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl index e04571b065..72519ad214 100644 --- a/test/intrinsics/gen/floor/60d7ea.wgsl +++ b/test/intrinsics/gen/floor/60d7ea.wgsl @@ -27,8 +27,9 @@ fn floor_60d7ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_60d7ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl index 85d68ae51d..1fd8e71100 100644 --- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void floor_60d7ea() { float3 res = floor(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { floor_60d7ea(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl index 3cb741aec3..95b42aa3c8 100644 --- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void floor_60d7ea() { float3 res = floor(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { floor_60d7ea(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm index 28b16f2c19..77ecc59c24 100644 --- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %floor_60d7ea "floor_60d7ea" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%floor_60d7ea = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Floor %12 - OpStore %res %9 +%floor_60d7ea = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Floor %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %floor_60d7ea + %26 = OpFunctionCall %void %floor_60d7ea + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %floor_60d7ea +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %floor_60d7ea OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %floor_60d7ea +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %floor_60d7ea OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl index f21f972743..70593b99a0 100644 --- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn floor_60d7ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_60d7ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/66f154.wgsl b/test/intrinsics/gen/floor/66f154.wgsl index d0f5f332df..aad7b62045 100644 --- a/test/intrinsics/gen/floor/66f154.wgsl +++ b/test/intrinsics/gen/floor/66f154.wgsl @@ -27,8 +27,9 @@ fn floor_66f154() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_66f154(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl index 7fb4b6d249..dc573b6fc8 100644 --- a/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void floor_66f154() { float res = floor(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { floor_66f154(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl index 4f57a10c06..c93a90e1dd 100644 --- a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void floor_66f154() { float res = floor(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { floor_66f154(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm index ea32487136..76ab1fd11d 100644 --- a/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %floor_66f154 "floor_66f154" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%floor_66f154 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%floor_66f154 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Floor %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Floor %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %floor_66f154 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %floor_66f154 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %floor_66f154 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %floor_66f154 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %floor_66f154 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %floor_66f154 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl index 0dc4d1371d..efa80cd03c 100644 --- a/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn floor_66f154() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { floor_66f154(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl index 2660eeb9d1..3f65bf136c 100644 --- a/test/intrinsics/gen/fma/26a7a9.wgsl +++ b/test/intrinsics/gen/fma/26a7a9.wgsl @@ -27,8 +27,9 @@ fn fma_26a7a9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_26a7a9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl index a1a1a5e7d5..2acc8ac01c 100644 --- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fma_26a7a9() { float2 res = fma(float2(), float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fma_26a7a9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm index 89f91acd78..888ebb3976 100644 --- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fma_26a7a9 "fma_26a7a9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %fma_26a7a9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Fma %12 %12 %12 - OpStore %res %9 + %fma_26a7a9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Fma %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %fma_26a7a9 + %26 = OpFunctionCall %void %fma_26a7a9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %fma_26a7a9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %fma_26a7a9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %fma_26a7a9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %fma_26a7a9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl index aab4068854..7a261aa5fb 100644 --- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fma_26a7a9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_26a7a9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/6a3283.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl index 8ec11375bb..12df6a43df 100644 --- a/test/intrinsics/gen/fma/6a3283.wgsl +++ b/test/intrinsics/gen/fma/6a3283.wgsl @@ -27,8 +27,9 @@ fn fma_6a3283() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_6a3283(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl index c45bd40004..962630d693 100644 --- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fma_6a3283() { float4 res = fma(float4(), float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fma_6a3283(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm index 160fecc28c..5fd44facdb 100644 --- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fma_6a3283 "fma_6a3283" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %fma_6a3283 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Fma %12 %12 %12 - OpStore %res %9 + %fma_6a3283 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Fma %8 %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %fma_6a3283 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %fma_6a3283 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %fma_6a3283 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %fma_6a3283 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %fma_6a3283 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl index f8e9f345a4..486fc1815e 100644 --- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fma_6a3283() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_6a3283(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl index 9bc8727920..ba357a5e90 100644 --- a/test/intrinsics/gen/fma/c10ba3.wgsl +++ b/test/intrinsics/gen/fma/c10ba3.wgsl @@ -27,8 +27,9 @@ fn fma_c10ba3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_c10ba3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl index 0ad9e9ce4c..b0409f3442 100644 --- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fma_c10ba3() { float res = fma(1.0f, 1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fma_c10ba3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm index cd28d8ea53..96b804d6d3 100644 --- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fma_c10ba3 "fma_c10ba3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %fma_c10ba3 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %fma_c10ba3 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Fma %float_1 %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Fma %float_1 %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %fma_c10ba3 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %fma_c10ba3 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %fma_c10ba3 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %fma_c10ba3 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %fma_c10ba3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %fma_c10ba3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl index 58f5b948ba..8b2686702d 100644 --- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fma_c10ba3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_c10ba3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl index 2f788d3860..5e85b4530e 100644 --- a/test/intrinsics/gen/fma/e17c5c.wgsl +++ b/test/intrinsics/gen/fma/e17c5c.wgsl @@ -27,8 +27,9 @@ fn fma_e17c5c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_e17c5c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl index fb58389fdc..c40dff0e04 100644 --- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fma_e17c5c() { float3 res = fma(float3(), float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fma_e17c5c(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm index f53397558c..88e17ec2e6 100644 --- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fma_e17c5c "fma_e17c5c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %fma_e17c5c = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Fma %12 %12 %12 - OpStore %res %9 + %fma_e17c5c = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Fma %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %fma_e17c5c + %26 = OpFunctionCall %void %fma_e17c5c + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %fma_e17c5c +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %fma_e17c5c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %fma_e17c5c +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %fma_e17c5c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl index 23ed6e29a9..36f4d3592d 100644 --- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fma_e17c5c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fma_e17c5c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl index 7c2e38b375..ae41fa78b3 100644 --- a/test/intrinsics/gen/fract/8bc1e9.wgsl +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl @@ -27,8 +27,9 @@ fn fract_8bc1e9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_8bc1e9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl index 5cf81410ce..3dcf051f17 100644 --- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fract_8bc1e9() { float4 res = frac(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fract_8bc1e9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl index cd30c06baa..d4d52b27a7 100644 --- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fract_8bc1e9() { float4 res = fract(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fract_8bc1e9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm index bb69bbd096..49901a7159 100644 --- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fract_8bc1e9 "fract_8bc1e9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%fract_8bc1e9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Fract %12 - OpStore %res %9 +%fract_8bc1e9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Fract %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %fract_8bc1e9 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %fract_8bc1e9 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %fract_8bc1e9 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %fract_8bc1e9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %fract_8bc1e9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl index 5107174b1e..84583e0beb 100644 --- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fract_8bc1e9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_8bc1e9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/943cb1.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl index 754cd7d245..8aa8d3cc3a 100644 --- a/test/intrinsics/gen/fract/943cb1.wgsl +++ b/test/intrinsics/gen/fract/943cb1.wgsl @@ -27,8 +27,9 @@ fn fract_943cb1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_943cb1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl index 4a9152de07..413bae4757 100644 --- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fract_943cb1() { float2 res = frac(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fract_943cb1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl index 8df4530d6f..1c895839de 100644 --- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fract_943cb1() { float2 res = fract(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fract_943cb1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm index e1b796545b..105eb76b7a 100644 --- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fract_943cb1 "fract_943cb1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%fract_943cb1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Fract %12 - OpStore %res %9 +%fract_943cb1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Fract %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %fract_943cb1 + %26 = OpFunctionCall %void %fract_943cb1 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %fract_943cb1 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %fract_943cb1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %fract_943cb1 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %fract_943cb1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl index 88db883e30..89412b048c 100644 --- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fract_943cb1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_943cb1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/a49758.wgsl b/test/intrinsics/gen/fract/a49758.wgsl index d5f4528c6f..dbbaebf4fa 100644 --- a/test/intrinsics/gen/fract/a49758.wgsl +++ b/test/intrinsics/gen/fract/a49758.wgsl @@ -27,8 +27,9 @@ fn fract_a49758() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_a49758(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl index 4f27c5f579..e5f94769fd 100644 --- a/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fract_a49758() { float3 res = frac(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fract_a49758(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl index 6c302f2a3a..400fc0a035 100644 --- a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fract_a49758() { float3 res = fract(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fract_a49758(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm index ef18a353c0..48289e631e 100644 --- a/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fract_a49758 "fract_a49758" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%fract_a49758 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Fract %12 - OpStore %res %9 +%fract_a49758 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Fract %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %fract_a49758 + %26 = OpFunctionCall %void %fract_a49758 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %fract_a49758 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %fract_a49758 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %fract_a49758 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %fract_a49758 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl index f20dc80eb5..3423d0824a 100644 --- a/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fract_a49758() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_a49758(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl index 26b513ac44..3b3c84f0ab 100644 --- a/test/intrinsics/gen/fract/fa5c71.wgsl +++ b/test/intrinsics/gen/fract/fa5c71.wgsl @@ -27,8 +27,9 @@ fn fract_fa5c71() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_fa5c71(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl index 927ec31ede..97a0ec5c56 100644 --- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fract_fa5c71() { float res = frac(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { fract_fa5c71(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl index 5f113c2abf..5d6f2fcc21 100644 --- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void fract_fa5c71() { float res = fract(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { fract_fa5c71(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm index 5003c11bc8..09d3f99c67 100644 --- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %fract_fa5c71 "fract_fa5c71" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%fract_fa5c71 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%fract_fa5c71 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Fract %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Fract %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %fract_fa5c71 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %fract_fa5c71 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %fract_fa5c71 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %fract_fa5c71 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %fract_fa5c71 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %fract_fa5c71 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl index c2bed7c493..7b9f9e98e1 100644 --- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fract_fa5c71() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fract_fa5c71(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl index 485a26d2ed..c790bd0f16 100644 --- a/test/intrinsics/gen/frexp/1d6b62.wgsl +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl @@ -28,8 +28,9 @@ fn frexp_1d6b62() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_1d6b62(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm index f697f5921e..3342c71b01 100644 --- a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm @@ -1,59 +1,75 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader - %16 = OpExtInstImport "GLSL.std.450" + %20 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_1d6b62 "frexp_1d6b62" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %13 = OpConstantNull %v2int + %17 = OpConstantNull %v2int %v2float = OpTypeVector %float 2 - %17 = OpConstantNull %v2float + %21 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%frexp_1d6b62 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v2int Function %13 - %res = OpVariable %_ptr_Function_v2float Function %17 - %14 = OpExtInst %v2float %16 Frexp %17 %arg_1 - OpStore %res %14 +%frexp_1d6b62 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v2int Function %17 + %res = OpVariable %_ptr_Function_v2float Function %21 + %18 = OpExtInst %v2float %20 Frexp %21 %arg_1 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %frexp_1d6b62 + %32 = OpFunctionCall %void %frexp_1d6b62 + %33 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %frexp_1d6b62 +%fragment_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %frexp_1d6b62 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %29 = OpLabel - %30 = OpFunctionCall %void %frexp_1d6b62 +%compute_main = OpFunction %void None %9 + %38 = OpLabel + %39 = OpFunctionCall %void %frexp_1d6b62 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl index 9222be812a..bc2e1ab983 100644 --- a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_1d6b62() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_1d6b62(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl index 6e77b4aacc..2e1284c4d7 100644 --- a/test/intrinsics/gen/frexp/2507b2.wgsl +++ b/test/intrinsics/gen/frexp/2507b2.wgsl @@ -28,8 +28,9 @@ fn frexp_2507b2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_2507b2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm index 9f3228fc42..b937ce806b 100644 --- a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm @@ -1,59 +1,73 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader - %16 = OpExtInstImport "GLSL.std.450" + %19 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_2507b2 "frexp_2507b2" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %13 = OpConstantNull %v4uint - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %17 = OpConstantNull %v4uint %_ptr_Function_v4float = OpTypePointer Function %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%frexp_2507b2 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v4uint Function %13 - %res = OpVariable %_ptr_Function_v4float Function %17 - %14 = OpExtInst %v4float %16 Frexp %17 %arg_1 - OpStore %res %14 +%frexp_2507b2 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v4uint Function %17 + %res = OpVariable %_ptr_Function_v4float Function %8 + %18 = OpExtInst %v4float %19 Frexp %8 %arg_1 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %frexp_2507b2 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %frexp_2507b2 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %29 = OpLabel +%vertex_main = OpFunction %void None %9 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %frexp_2507b2 + %31 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %frexp_2507b2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %36 = OpLabel + %37 = OpFunctionCall %void %frexp_2507b2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl index 436b452090..1e09ae6baf 100644 --- a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_2507b2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_2507b2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl index d23094be15..856dbdaec2 100644 --- a/test/intrinsics/gen/frexp/2a171c.wgsl +++ b/test/intrinsics/gen/frexp/2a171c.wgsl @@ -28,8 +28,9 @@ fn frexp_2a171c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_2a171c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm index 3fa83d3165..2369b9f669 100644 --- a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm @@ -1,59 +1,75 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader - %16 = OpExtInstImport "GLSL.std.450" + %20 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_2a171c "frexp_2a171c" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 %_ptr_Function_v2uint = OpTypePointer Function %v2uint - %13 = OpConstantNull %v2uint + %17 = OpConstantNull %v2uint %v2float = OpTypeVector %float 2 - %17 = OpConstantNull %v2float + %21 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%frexp_2a171c = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v2uint Function %13 - %res = OpVariable %_ptr_Function_v2float Function %17 - %14 = OpExtInst %v2float %16 Frexp %17 %arg_1 - OpStore %res %14 +%frexp_2a171c = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v2uint Function %17 + %res = OpVariable %_ptr_Function_v2float Function %21 + %18 = OpExtInst %v2float %20 Frexp %21 %arg_1 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %frexp_2a171c + %32 = OpFunctionCall %void %frexp_2a171c + %33 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %frexp_2a171c +%fragment_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %frexp_2a171c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %29 = OpLabel - %30 = OpFunctionCall %void %frexp_2a171c +%compute_main = OpFunction %void None %9 + %38 = OpLabel + %39 = OpFunctionCall %void %frexp_2a171c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl index e5bdf95d02..ffd3acdbf1 100644 --- a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_2a171c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_2a171c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl index 848bd3f157..50bc56c140 100644 --- a/test/intrinsics/gen/frexp/34dd30.wgsl +++ b/test/intrinsics/gen/frexp/34dd30.wgsl @@ -28,8 +28,9 @@ fn frexp_34dd30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_34dd30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm index 2e9b4d9772..3dc8037980 100644 --- a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm @@ -1,56 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %18 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_34dd30 "frexp_34dd30" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %_ptr_Function_uint = OpTypePointer Function %uint - %12 = OpConstantNull %uint + %16 = OpConstantNull %uint %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%frexp_34dd30 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_uint Function %12 + %23 = OpTypeFunction %void %v4float +%frexp_34dd30 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_uint Function %16 %res = OpVariable %_ptr_Function_float Function %4 - %13 = OpExtInst %float %14 Frexp %float_1 %arg_1 - OpStore %res %13 + %17 = OpExtInst %float %18 Frexp %float_1 %arg_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %frexp_34dd30 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %frexp_34dd30 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %frexp_34dd30 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %28 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %frexp_34dd30 + %30 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %frexp_34dd30 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %frexp_34dd30 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl index c43e4c1b68..82331dbe47 100644 --- a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_34dd30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_34dd30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl index d4c58427c8..32a16bd414 100644 --- a/test/intrinsics/gen/frexp/4b73e3.wgsl +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl @@ -28,8 +28,9 @@ fn frexp_4b73e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_4b73e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm index ab2f023fc8..f3901b43dc 100644 --- a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm @@ -1,59 +1,73 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader - %16 = OpExtInstImport "GLSL.std.450" + %19 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_4b73e3 "frexp_4b73e3" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 %_ptr_Function_v4int = OpTypePointer Function %v4int - %13 = OpConstantNull %v4int - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %17 = OpConstantNull %v4int %_ptr_Function_v4float = OpTypePointer Function %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%frexp_4b73e3 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v4int Function %13 - %res = OpVariable %_ptr_Function_v4float Function %17 - %14 = OpExtInst %v4float %16 Frexp %17 %arg_1 - OpStore %res %14 +%frexp_4b73e3 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v4int Function %17 + %res = OpVariable %_ptr_Function_v4float Function %8 + %18 = OpExtInst %v4float %19 Frexp %8 %arg_1 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %frexp_4b73e3 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %frexp_4b73e3 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %29 = OpLabel +%vertex_main = OpFunction %void None %9 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %frexp_4b73e3 + %31 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %frexp_4b73e3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %36 = OpLabel + %37 = OpFunctionCall %void %frexp_4b73e3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl index 3672ae0bbd..8726a64c14 100644 --- a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_4b73e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_4b73e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl index 2acbd4c709..4debf1d6cb 100644 --- a/test/intrinsics/gen/frexp/79ed81.wgsl +++ b/test/intrinsics/gen/frexp/79ed81.wgsl @@ -28,8 +28,9 @@ fn frexp_79ed81() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_79ed81(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm index 2a7f73631b..be88edded3 100644 --- a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm @@ -1,59 +1,75 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader - %16 = OpExtInstImport "GLSL.std.450" + %20 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_79ed81 "frexp_79ed81" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %13 = OpConstantNull %v3int + %17 = OpConstantNull %v3int %v3float = OpTypeVector %float 3 - %17 = OpConstantNull %v3float + %21 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%frexp_79ed81 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v3int Function %13 - %res = OpVariable %_ptr_Function_v3float Function %17 - %14 = OpExtInst %v3float %16 Frexp %17 %arg_1 - OpStore %res %14 +%frexp_79ed81 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v3int Function %17 + %res = OpVariable %_ptr_Function_v3float Function %21 + %18 = OpExtInst %v3float %20 Frexp %21 %arg_1 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %frexp_79ed81 + %32 = OpFunctionCall %void %frexp_79ed81 + %33 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %frexp_79ed81 +%fragment_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %frexp_79ed81 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %29 = OpLabel - %30 = OpFunctionCall %void %frexp_79ed81 +%compute_main = OpFunction %void None %9 + %38 = OpLabel + %39 = OpFunctionCall %void %frexp_79ed81 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl index 170e25514d..8c5eff84b0 100644 --- a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_79ed81() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_79ed81(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/99b922.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl index 5d2cf6e812..44f19766ce 100644 --- a/test/intrinsics/gen/frexp/99b922.wgsl +++ b/test/intrinsics/gen/frexp/99b922.wgsl @@ -28,8 +28,9 @@ fn frexp_99b922() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_99b922(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm index 03670ba496..5b3d37c541 100644 --- a/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm @@ -1,56 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %18 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_99b922 "frexp_99b922" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %12 = OpConstantNull %int + %16 = OpConstantNull %int %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%frexp_99b922 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_int Function %12 + %23 = OpTypeFunction %void %v4float +%frexp_99b922 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_int Function %16 %res = OpVariable %_ptr_Function_float Function %4 - %13 = OpExtInst %float %14 Frexp %float_1 %arg_1 - OpStore %res %13 + %17 = OpExtInst %float %18 Frexp %float_1 %arg_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %frexp_99b922 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %frexp_99b922 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %frexp_99b922 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %28 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %frexp_99b922 + %30 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %frexp_99b922 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %frexp_99b922 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl index e07d4c3b1e..6f56b9ee6f 100644 --- a/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_99b922() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_99b922(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl index 298d24ea8e..5bbb652105 100644 --- a/test/intrinsics/gen/frexp/cb41c5.wgsl +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl @@ -28,8 +28,9 @@ fn frexp_cb41c5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_cb41c5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm index bec511a9c7..f539a3ccb7 100644 --- a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm @@ -1,59 +1,75 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader - %16 = OpExtInstImport "GLSL.std.450" + %20 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %frexp_cb41c5 "frexp_cb41c5" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 %_ptr_Function_v3uint = OpTypePointer Function %v3uint - %13 = OpConstantNull %v3uint + %17 = OpConstantNull %v3uint %v3float = OpTypeVector %float 3 - %17 = OpConstantNull %v3float + %21 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%frexp_cb41c5 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v3uint Function %13 - %res = OpVariable %_ptr_Function_v3float Function %17 - %14 = OpExtInst %v3float %16 Frexp %17 %arg_1 - OpStore %res %14 +%frexp_cb41c5 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v3uint Function %17 + %res = OpVariable %_ptr_Function_v3float Function %21 + %18 = OpExtInst %v3float %20 Frexp %21 %arg_1 + OpStore %res %18 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %frexp_cb41c5 + %32 = OpFunctionCall %void %frexp_cb41c5 + %33 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %frexp_cb41c5 +%fragment_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %frexp_cb41c5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %29 = OpLabel - %30 = OpFunctionCall %void %frexp_cb41c5 +%compute_main = OpFunction %void None %9 + %38 = OpLabel + %39 = OpFunctionCall %void %frexp_cb41c5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl index 7fcb8e0ca1..24c63bad5a 100644 --- a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn frexp_cb41c5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { frexp_cb41c5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl index 3a7a285f72..f004cf4248 100644 --- a/test/intrinsics/gen/fwidth/5d1b39.wgsl +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl @@ -27,8 +27,9 @@ fn fwidth_5d1b39() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_5d1b39(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl index 1d700b1ef6..9537c9b633 100644 --- a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidth_5d1b39() { float3 res = fwidth(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidth_5d1b39(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl index bee6d3ffa1..966c33a44f 100644 --- a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidth_5d1b39() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_5d1b39(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl index 9f657d16ae..96f3d2b05b 100644 --- a/test/intrinsics/gen/fwidth/b83ebb.wgsl +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl @@ -27,8 +27,9 @@ fn fwidth_b83ebb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_b83ebb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl index db5d8aa7ae..25357eb007 100644 --- a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidth_b83ebb() { float2 res = fwidth(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidth_b83ebb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl index 4618777876..bffa899178 100644 --- a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidth_b83ebb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_b83ebb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl index 1110b54333..18c912e322 100644 --- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl @@ -27,8 +27,9 @@ fn fwidth_d2ab9a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_d2ab9a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl index e963fc6a3e..f72c10686f 100644 --- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidth_d2ab9a() { float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidth_d2ab9a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl index 95ec91a24f..c8b11c6451 100644 --- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidth_d2ab9a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_d2ab9a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl index d83071290d..64490c34e2 100644 --- a/test/intrinsics/gen/fwidth/df38ef.wgsl +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl @@ -27,8 +27,9 @@ fn fwidth_df38ef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_df38ef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl index 4610453e06..aa1fd4504e 100644 --- a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidth_df38ef() { float res = fwidth(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { fwidth_df38ef(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl index cf808fe10c..b19db9900a 100644 --- a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidth_df38ef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidth_df38ef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl index eb1a5da293..c9f50b78d5 100644 --- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl @@ -27,8 +27,9 @@ fn fwidthCoarse_159c8a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_159c8a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl index 356be65fd8..846633d3bf 100644 --- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthCoarse_159c8a() { float res = fwidth(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { fwidthCoarse_159c8a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl index 38b8696c6e..abde6f882e 100644 --- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthCoarse_159c8a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_159c8a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl index 05b4fcf0db..31bd377f3e 100644 --- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl @@ -27,8 +27,9 @@ fn fwidthCoarse_1e59d9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_1e59d9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl index e3e1f18fd7..fa99a242d1 100644 --- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthCoarse_1e59d9() { float3 res = fwidth(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidthCoarse_1e59d9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl index adb83b7302..e55be2823d 100644 --- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthCoarse_1e59d9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_1e59d9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl index 933322fe29..0c4fae0270 100644 --- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl @@ -27,8 +27,9 @@ fn fwidthCoarse_4e4fc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_4e4fc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl index ba1c1410c7..89aad0fb74 100644 --- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthCoarse_4e4fc4() { float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidthCoarse_4e4fc4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl index 245a06c321..04e4b3a511 100644 --- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthCoarse_4e4fc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_4e4fc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl index 928a912a7d..a5492f63c7 100644 --- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl @@ -27,8 +27,9 @@ fn fwidthCoarse_e653f7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_e653f7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl index dc9e72136f..a13ab5cc73 100644 --- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthCoarse_e653f7() { float2 res = fwidth(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidthCoarse_e653f7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl index c0568f99c5..123e26f600 100644 --- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthCoarse_e653f7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthCoarse_e653f7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl index 2db8dfb463..284fa48c84 100644 --- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl @@ -27,8 +27,9 @@ fn fwidthFine_523fdc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_523fdc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl index a270d2dd35..4ad5e9feb7 100644 --- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthFine_523fdc() { float3 res = fwidth(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidthFine_523fdc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl index e7c73a9daf..28a6e6a1ed 100644 --- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthFine_523fdc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_523fdc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl index de6e3febec..6591e4a6d0 100644 --- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl @@ -27,8 +27,9 @@ fn fwidthFine_68f4ef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_68f4ef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl index 23406ee9e1..b7788d51e3 100644 --- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthFine_68f4ef() { float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidthFine_68f4ef(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl index 9cc262520c..467bdcc62e 100644 --- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthFine_68f4ef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_68f4ef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl index be30a23fcb..13cfd38b42 100644 --- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl @@ -27,8 +27,9 @@ fn fwidthFine_f1742d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_f1742d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl index 774093a398..3a62a954d4 100644 --- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthFine_f1742d() { float res = fwidth(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { fwidthFine_f1742d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl index 93e90834e2..f085f7d91b 100644 --- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthFine_f1742d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_f1742d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl index 629a950c2e..a2fcc4e8ff 100644 --- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl @@ -27,8 +27,9 @@ fn fwidthFine_ff6aa0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_ff6aa0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl index f38c96adaf..4cd1a2f535 100644 --- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void fwidthFine_ff6aa0() { float2 res = fwidth(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { fwidthFine_ff6aa0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl index 4d0bcb60b2..578a12e0a0 100644 --- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn fwidthFine_ff6aa0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { fwidthFine_ff6aa0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl index 070d48c5c7..432e2f871f 100644 --- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl @@ -27,8 +27,9 @@ fn inverseSqrt_84407e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_84407e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl index 2a185e9ca4..4c8f482069 100644 --- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void inverseSqrt_84407e() { float res = rsqrt(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { inverseSqrt_84407e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl index 9e3ec223b2..0ff2cd01ec 100644 --- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void inverseSqrt_84407e() { float res = rsqrt(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { inverseSqrt_84407e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm index d00a8e2f84..33a4c984ae 100644 --- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %inverseSqrt_84407e "inverseSqrt_84407e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%inverseSqrt_84407e = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%inverseSqrt_84407e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 InverseSqrt %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 InverseSqrt %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %inverseSqrt_84407e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %inverseSqrt_84407e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %inverseSqrt_84407e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %inverseSqrt_84407e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %inverseSqrt_84407e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %inverseSqrt_84407e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl index d1a2d35bf2..fb37a945fe 100644 --- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn inverseSqrt_84407e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_84407e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl index bb7bd2bf05..10d4b749c9 100644 --- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl @@ -27,8 +27,9 @@ fn inverseSqrt_8f2bd2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_8f2bd2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl index efa0978d97..747c9a54b5 100644 --- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void inverseSqrt_8f2bd2() { float2 res = rsqrt(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { inverseSqrt_8f2bd2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl index 15325bc1aa..beeb2cbee8 100644 --- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void inverseSqrt_8f2bd2() { float2 res = rsqrt(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { inverseSqrt_8f2bd2(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm index 9f2fae125d..2ec31e8c8c 100644 --- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %inverseSqrt_8f2bd2 "inverseSqrt_8f2bd2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%inverseSqrt_8f2bd2 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 InverseSqrt %12 - OpStore %res %9 +%inverseSqrt_8f2bd2 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 InverseSqrt %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %inverseSqrt_8f2bd2 + %26 = OpFunctionCall %void %inverseSqrt_8f2bd2 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %inverseSqrt_8f2bd2 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %inverseSqrt_8f2bd2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %inverseSqrt_8f2bd2 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %inverseSqrt_8f2bd2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl index 496ae2363c..f31778b19a 100644 --- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn inverseSqrt_8f2bd2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_8f2bd2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl index dda36270ac..14a84cb3f9 100644 --- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl @@ -27,8 +27,9 @@ fn inverseSqrt_b197b1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_b197b1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl index 3f411b9d0f..bf44bfe33f 100644 --- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void inverseSqrt_b197b1() { float3 res = rsqrt(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { inverseSqrt_b197b1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl index 4fecada513..da0d9714a9 100644 --- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void inverseSqrt_b197b1() { float3 res = rsqrt(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { inverseSqrt_b197b1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm index 2d8c81c6dd..beb34540f9 100644 --- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %inverseSqrt_b197b1 "inverseSqrt_b197b1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%inverseSqrt_b197b1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 InverseSqrt %12 - OpStore %res %9 +%inverseSqrt_b197b1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 InverseSqrt %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %inverseSqrt_b197b1 + %26 = OpFunctionCall %void %inverseSqrt_b197b1 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %inverseSqrt_b197b1 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %inverseSqrt_b197b1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %inverseSqrt_b197b1 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %inverseSqrt_b197b1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl index 0025c3461a..8481d34ca3 100644 --- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn inverseSqrt_b197b1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_b197b1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl index 35a6a147c4..0f57c7c14b 100644 --- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl @@ -27,8 +27,9 @@ fn inverseSqrt_c22347() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_c22347(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl index 28b66a7eec..b67ba973ba 100644 --- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void inverseSqrt_c22347() { float4 res = rsqrt(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { inverseSqrt_c22347(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl index a8f49dab2c..07deeaad49 100644 --- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void inverseSqrt_c22347() { float4 res = rsqrt(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { inverseSqrt_c22347(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm index 55bfc4861b..8bcc297597 100644 --- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %inverseSqrt_c22347 "inverseSqrt_c22347" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%inverseSqrt_c22347 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 InverseSqrt %12 - OpStore %res %9 +%inverseSqrt_c22347 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 InverseSqrt %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %inverseSqrt_c22347 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %inverseSqrt_c22347 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %inverseSqrt_c22347 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %inverseSqrt_c22347 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %inverseSqrt_c22347 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl index 268014fff6..692ba58498 100644 --- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn inverseSqrt_c22347() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { inverseSqrt_c22347(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl index f156dafa2a..4d20d3a5c9 100644 --- a/test/intrinsics/gen/isFinite/34d32b.wgsl +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl @@ -27,8 +27,9 @@ fn isFinite_34d32b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_34d32b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl index e700d05490..fd5747e974 100644 --- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isFinite_34d32b() { vector res = isfinite(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { isFinite_34d32b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl index 575853781d..be2ba66649 100644 --- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isFinite_34d32b() { bool2 res = isfinite(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isFinite_34d32b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm index 12d350111d..852e9069bd 100644 --- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm @@ -1,58 +1,74 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isFinite_34d32b "isFinite_34d32b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %_ptr_Function_v2bool = OpTypePointer Function %v2bool - %19 = OpConstantNull %v2bool + %23 = OpConstantNull %v2bool + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isFinite_34d32b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2bool Function %19 - %14 = OpIsInf %v2bool %13 - %15 = OpIsNan %v2bool %13 - %16 = OpLogicalOr %v2bool %14 %15 - %9 = OpLogicalNot %v2bool %16 - OpStore %res %9 +%isFinite_34d32b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %23 + %18 = OpIsInf %v2bool %17 + %19 = OpIsNan %v2bool %17 + %20 = OpLogicalOr %v2bool %18 %19 + %13 = OpLogicalNot %v2bool %20 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %isFinite_34d32b + %31 = OpFunctionCall %void %isFinite_34d32b + %32 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %isFinite_34d32b +%fragment_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isFinite_34d32b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %28 = OpLabel - %29 = OpFunctionCall %void %isFinite_34d32b +%compute_main = OpFunction %void None %9 + %37 = OpLabel + %38 = OpFunctionCall %void %isFinite_34d32b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl index a50f43c66d..35bad2a961 100644 --- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isFinite_34d32b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_34d32b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl index 72f866bbc2..19ae66ed0f 100644 --- a/test/intrinsics/gen/isFinite/426f9f.wgsl +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl @@ -27,8 +27,9 @@ fn isFinite_426f9f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_426f9f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl index 83b92bff20..d46bad6a44 100644 --- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isFinite_426f9f() { bool res = isfinite(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { isFinite_426f9f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl index 27e7955b69..fc6d588ae0 100644 --- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isFinite_426f9f() { bool res = isfinite(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isFinite_426f9f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm index cca76055eb..4b54ee857d 100644 --- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isFinite_426f9f "isFinite_426f9f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %float_1 = OpConstant %float 1 %_ptr_Function_bool = OpTypePointer Function %bool - %17 = OpConstantNull %bool -%isFinite_426f9f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %17 - %12 = OpIsInf %bool %float_1 - %13 = OpIsNan %bool %float_1 - %14 = OpLogicalOr %bool %12 %13 - %9 = OpLogicalNot %bool %14 - OpStore %res %9 + %21 = OpConstantNull %bool + %22 = OpTypeFunction %void %v4float +%isFinite_426f9f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %21 + %16 = OpIsInf %bool %float_1 + %17 = OpIsNan %bool %float_1 + %18 = OpLogicalOr %bool %16 %17 + %13 = OpLogicalNot %bool %18 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isFinite_426f9f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %isFinite_426f9f - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %isFinite_426f9f + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %27 = OpLabel + OpStore %tint_pointsize %float_1 + %28 = OpFunctionCall %void %isFinite_426f9f + %29 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isFinite_426f9f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isFinite_426f9f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl index 458d18fd50..7b583b254f 100644 --- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isFinite_426f9f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_426f9f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl index 06f16937b0..9b34e32d68 100644 --- a/test/intrinsics/gen/isFinite/8a23ad.wgsl +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl @@ -27,8 +27,9 @@ fn isFinite_8a23ad() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_8a23ad(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl index b8915539fb..010d015f4b 100644 --- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isFinite_8a23ad() { vector res = isfinite(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { isFinite_8a23ad(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl index 3bfe1d389d..9ecb4a4c33 100644 --- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isFinite_8a23ad() { bool3 res = isfinite(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isFinite_8a23ad(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm index 45f72cf868..1bfb11b97e 100644 --- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm @@ -1,58 +1,74 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isFinite_8a23ad "isFinite_8a23ad" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 %v3float = OpTypeVector %float 3 - %13 = OpConstantNull %v3float + %17 = OpConstantNull %v3float %_ptr_Function_v3bool = OpTypePointer Function %v3bool - %19 = OpConstantNull %v3bool + %23 = OpConstantNull %v3bool + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isFinite_8a23ad = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3bool Function %19 - %14 = OpIsInf %v3bool %13 - %15 = OpIsNan %v3bool %13 - %16 = OpLogicalOr %v3bool %14 %15 - %9 = OpLogicalNot %v3bool %16 - OpStore %res %9 +%isFinite_8a23ad = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %23 + %18 = OpIsInf %v3bool %17 + %19 = OpIsNan %v3bool %17 + %20 = OpLogicalOr %v3bool %18 %19 + %13 = OpLogicalNot %v3bool %20 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %isFinite_8a23ad + %31 = OpFunctionCall %void %isFinite_8a23ad + %32 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %isFinite_8a23ad +%fragment_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isFinite_8a23ad OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %28 = OpLabel - %29 = OpFunctionCall %void %isFinite_8a23ad +%compute_main = OpFunction %void None %9 + %37 = OpLabel + %38 = OpFunctionCall %void %isFinite_8a23ad OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl index 1cb9665aa0..802869acf1 100644 --- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isFinite_8a23ad() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_8a23ad(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl index 9747c63348..35c6b5e0b9 100644 --- a/test/intrinsics/gen/isFinite/f31987.wgsl +++ b/test/intrinsics/gen/isFinite/f31987.wgsl @@ -27,8 +27,9 @@ fn isFinite_f31987() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_f31987(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl index 6e9a1af07f..ba30f1a218 100644 --- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isFinite_f31987() { vector res = isfinite(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { isFinite_f31987(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl index f8184b31c4..0cd88d997f 100644 --- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isFinite_f31987() { bool4 res = isfinite(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isFinite_f31987(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm index 20008cb7ee..5e80787de9 100644 --- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm @@ -1,58 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isFinite_f31987 "isFinite_f31987" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %v4float = OpTypeVector %float 4 - %13 = OpConstantNull %v4float %_ptr_Function_v4bool = OpTypePointer Function %v4bool - %19 = OpConstantNull %v4bool + %21 = OpConstantNull %v4bool + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isFinite_f31987 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4bool Function %19 - %14 = OpIsInf %v4bool %13 - %15 = OpIsNan %v4bool %13 - %16 = OpLogicalOr %v4bool %14 %15 - %9 = OpLogicalNot %v4bool %16 - OpStore %res %9 +%isFinite_f31987 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %21 + %16 = OpIsInf %v4bool %8 + %17 = OpIsNan %v4bool %8 + %18 = OpLogicalOr %v4bool %16 %17 + %13 = OpLogicalNot %v4bool %18 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %isFinite_f31987 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %isFinite_f31987 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %28 = OpLabel +%vertex_main = OpFunction %void None %9 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %isFinite_f31987 + %30 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %isFinite_f31987 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %isFinite_f31987 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl index 63c77f5fe8..65f538ab5b 100644 --- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isFinite_f31987() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isFinite_f31987(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl index fb0708cc53..b0a4e24bd5 100644 --- a/test/intrinsics/gen/isInf/666f2a.wgsl +++ b/test/intrinsics/gen/isInf/666f2a.wgsl @@ -27,8 +27,9 @@ fn isInf_666f2a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_666f2a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl index 70986264f3..c18d7bbe03 100644 --- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isInf_666f2a() { vector res = isinf(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { isInf_666f2a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl index f2f6709d2b..39d8aa9c73 100644 --- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isInf_666f2a() { bool3 res = isinf(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isInf_666f2a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm index b42d0f5933..34a0c56175 100644 --- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isInf_666f2a "isInf_666f2a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 %v3float = OpTypeVector %float 3 - %13 = OpConstantNull %v3float + %17 = OpConstantNull %v3float %_ptr_Function_v3bool = OpTypePointer Function %v3bool - %16 = OpConstantNull %v3bool + %20 = OpConstantNull %v3bool + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isInf_666f2a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3bool Function %16 - %9 = OpIsInf %v3bool %13 - OpStore %res %9 +%isInf_666f2a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %20 + %13 = OpIsInf %v3bool %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isInf_666f2a + %28 = OpFunctionCall %void %isInf_666f2a + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %isInf_666f2a +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isInf_666f2a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %isInf_666f2a +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isInf_666f2a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl index aaf35df22f..cf5f8bb5d5 100644 --- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isInf_666f2a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_666f2a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl index a6598566be..c4d91f7bc7 100644 --- a/test/intrinsics/gen/isInf/7bd98f.wgsl +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl @@ -27,8 +27,9 @@ fn isInf_7bd98f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_7bd98f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl index bb7d9757da..aa952bbb79 100644 --- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isInf_7bd98f() { bool res = isinf(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { isInf_7bd98f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl index 8623d0e0a9..6cec857d7d 100644 --- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isInf_7bd98f() { bool res = isinf(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isInf_7bd98f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm index 361f0f8776..f538f3a4c6 100644 --- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm @@ -1,52 +1,68 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 24 +; Bound: 33 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isInf_7bd98f "isInf_7bd98f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %float_1 = OpConstant %float 1 %_ptr_Function_bool = OpTypePointer Function %bool - %14 = OpConstantNull %bool -%isInf_7bd98f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %14 - %9 = OpIsInf %bool %float_1 - OpStore %res %9 + %18 = OpConstantNull %bool + %19 = OpTypeFunction %void %v4float +%isInf_7bd98f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %18 + %13 = OpIsInf %bool %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %17 = OpFunctionCall %void %isInf_7bd98f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %19 = OpLabel - %20 = OpFunctionCall %void %isInf_7bd98f - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %isInf_7bd98f + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %isInf_7bd98f + %26 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %isInf_7bd98f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isInf_7bd98f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl index 1fe501e548..b9bb97e314 100644 --- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isInf_7bd98f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_7bd98f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl index 7462bd29f4..1af1d4033c 100644 --- a/test/intrinsics/gen/isInf/7e81b5.wgsl +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl @@ -27,8 +27,9 @@ fn isInf_7e81b5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_7e81b5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl index 00db4f3666..c7019e2011 100644 --- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isInf_7e81b5() { vector res = isinf(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { isInf_7e81b5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl index 331e462e93..e8636d9025 100644 --- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isInf_7e81b5() { bool4 res = isinf(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isInf_7e81b5(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm index 8fc9a10b54..7b5ba049df 100644 --- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isInf_7e81b5 "isInf_7e81b5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %v4float = OpTypeVector %float 4 - %13 = OpConstantNull %v4float %_ptr_Function_v4bool = OpTypePointer Function %v4bool - %16 = OpConstantNull %v4bool + %18 = OpConstantNull %v4bool + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isInf_7e81b5 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4bool Function %16 - %9 = OpIsInf %v4bool %13 - OpStore %res %9 +%isInf_7e81b5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %18 + %13 = OpIsInf %v4bool %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isInf_7e81b5 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %isInf_7e81b5 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %isInf_7e81b5 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %isInf_7e81b5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %isInf_7e81b5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl index 749e65337a..353e589871 100644 --- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isInf_7e81b5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_7e81b5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl index 336593b539..d2ac8eac1f 100644 --- a/test/intrinsics/gen/isInf/a46d6f.wgsl +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl @@ -27,8 +27,9 @@ fn isInf_a46d6f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_a46d6f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl index dd76a70849..93d5e9e194 100644 --- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isInf_a46d6f() { vector res = isinf(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { isInf_a46d6f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl index 41925dec17..d423213c5c 100644 --- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isInf_a46d6f() { bool2 res = isinf(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isInf_a46d6f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm index 5b3fe9b68f..20f293b9b9 100644 --- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isInf_a46d6f "isInf_a46d6f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %_ptr_Function_v2bool = OpTypePointer Function %v2bool - %16 = OpConstantNull %v2bool + %20 = OpConstantNull %v2bool + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isInf_a46d6f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2bool Function %16 - %9 = OpIsInf %v2bool %13 - OpStore %res %9 +%isInf_a46d6f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %20 + %13 = OpIsInf %v2bool %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isInf_a46d6f + %28 = OpFunctionCall %void %isInf_a46d6f + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %isInf_a46d6f +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isInf_a46d6f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %isInf_a46d6f +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isInf_a46d6f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl index 0166b73982..1c04e2dc41 100644 --- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isInf_a46d6f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isInf_a46d6f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl index 5297e910a4..0375ee5bc4 100644 --- a/test/intrinsics/gen/isNan/1280ab.wgsl +++ b/test/intrinsics/gen/isNan/1280ab.wgsl @@ -27,8 +27,9 @@ fn isNan_1280ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_1280ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl index c19b61d409..aa45bd0413 100644 --- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNan_1280ab() { bool3 res = isnan(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNan_1280ab(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm index f678b423b3..e8bec2740c 100644 --- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNan_1280ab "isNan_1280ab" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 %v3float = OpTypeVector %float 3 - %13 = OpConstantNull %v3float + %17 = OpConstantNull %v3float %_ptr_Function_v3bool = OpTypePointer Function %v3bool - %16 = OpConstantNull %v3bool + %20 = OpConstantNull %v3bool + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isNan_1280ab = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3bool Function %16 - %9 = OpIsNan %v3bool %13 - OpStore %res %9 +%isNan_1280ab = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %20 + %13 = OpIsNan %v3bool %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isNan_1280ab + %28 = OpFunctionCall %void %isNan_1280ab + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %isNan_1280ab +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isNan_1280ab OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %isNan_1280ab +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isNan_1280ab OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl index 4e728d7341..9bb6fe20b3 100644 --- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNan_1280ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_1280ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl index fb64518af2..5e6a83fb17 100644 --- a/test/intrinsics/gen/isNan/4d280d.wgsl +++ b/test/intrinsics/gen/isNan/4d280d.wgsl @@ -27,8 +27,9 @@ fn isNan_4d280d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_4d280d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl index 3b4b9e5566..28fc710cc2 100644 --- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNan_4d280d() { bool4 res = isnan(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNan_4d280d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm index 39e7eddc84..56ba241c80 100644 --- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNan_4d280d "isNan_4d280d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %v4float = OpTypeVector %float 4 - %13 = OpConstantNull %v4float %_ptr_Function_v4bool = OpTypePointer Function %v4bool - %16 = OpConstantNull %v4bool + %18 = OpConstantNull %v4bool + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isNan_4d280d = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4bool Function %16 - %9 = OpIsNan %v4bool %13 - OpStore %res %9 +%isNan_4d280d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %18 + %13 = OpIsNan %v4bool %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isNan_4d280d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %isNan_4d280d + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %isNan_4d280d + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %isNan_4d280d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %isNan_4d280d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl index f0acfc5c63..fe0a18a5be 100644 --- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNan_4d280d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_4d280d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl index 030cd011d6..2d6d6a07bd 100644 --- a/test/intrinsics/gen/isNan/67ecd3.wgsl +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl @@ -27,8 +27,9 @@ fn isNan_67ecd3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_67ecd3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl index 66587ba26b..12439ba984 100644 --- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNan_67ecd3() { bool2 res = isnan(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNan_67ecd3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm index de78ebc15b..fe0be0d3cb 100644 --- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNan_67ecd3 "isNan_67ecd3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %_ptr_Function_v2bool = OpTypePointer Function %v2bool - %16 = OpConstantNull %v2bool + %20 = OpConstantNull %v2bool + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isNan_67ecd3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2bool Function %16 - %9 = OpIsNan %v2bool %13 - OpStore %res %9 +%isNan_67ecd3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %20 + %13 = OpIsNan %v2bool %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %isNan_67ecd3 + %28 = OpFunctionCall %void %isNan_67ecd3 + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %isNan_67ecd3 +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isNan_67ecd3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %isNan_67ecd3 +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %isNan_67ecd3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl index dcdd0deb8a..c4ae42305e 100644 --- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNan_67ecd3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_67ecd3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl index ca06e2366c..de38f572fe 100644 --- a/test/intrinsics/gen/isNan/e4978e.wgsl +++ b/test/intrinsics/gen/isNan/e4978e.wgsl @@ -27,8 +27,9 @@ fn isNan_e4978e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_e4978e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl index cf183f7c96..688ff07296 100644 --- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void isNan_e4978e() { bool res = isnan(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { isNan_e4978e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl index b308160c0e..cad8c71f99 100644 --- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNan_e4978e() { bool res = isnan(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNan_e4978e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm index c8cf7ca528..4d21c4d8cc 100644 --- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm @@ -1,52 +1,68 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 24 +; Bound: 33 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNan_e4978e "isNan_e4978e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %float_1 = OpConstant %float 1 %_ptr_Function_bool = OpTypePointer Function %bool - %14 = OpConstantNull %bool -%isNan_e4978e = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %14 - %9 = OpIsNan %bool %float_1 - OpStore %res %9 + %18 = OpConstantNull %bool + %19 = OpTypeFunction %void %v4float +%isNan_e4978e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %18 + %13 = OpIsNan %bool %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %17 = OpFunctionCall %void %isNan_e4978e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %19 = OpLabel - %20 = OpFunctionCall %void %isNan_e4978e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %isNan_e4978e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %isNan_e4978e + %26 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %isNan_e4978e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %isNan_e4978e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl index ecdc24f885..25565a8c5f 100644 --- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNan_e4978e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNan_e4978e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl index 7098af1691..3733474d18 100644 --- a/test/intrinsics/gen/isNormal/863dcd.wgsl +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl @@ -27,8 +27,9 @@ fn isNormal_863dcd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_863dcd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl index 864e4ef005..67595de1b5 100644 --- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNormal_863dcd() { bool4 res = isnormal(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNormal_863dcd(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm index 9d47ef5e1b..ec938ef2fc 100644 --- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm @@ -1,67 +1,81 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 46 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNormal_863dcd "isNormal_863dcd" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %v4float = OpTypeVector %float 4 - %13 = OpConstantNull %v4float %uint = OpTypeInt 32 0 %uint_133693440 = OpConstant %uint 133693440 %uint_524288 = OpConstant %uint 524288 %uint_133169152 = OpConstant %uint 133169152 %v4uint = OpTypeVector %uint 4 %_ptr_Function_v4bool = OpTypePointer Function %v4bool - %28 = OpConstantNull %v4bool + %30 = OpConstantNull %v4bool + %31 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isNormal_863dcd = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4bool Function %28 - %20 = OpCompositeConstruct %v4uint %uint_133693440 %uint_133693440 %uint_133693440 %uint_133693440 - %21 = OpCompositeConstruct %v4uint %uint_524288 %uint_524288 %uint_524288 %uint_524288 - %22 = OpCompositeConstruct %v4uint %uint_133169152 %uint_133169152 %uint_133169152 %uint_133169152 - %23 = OpBitcast %v4uint %13 - %24 = OpBitwiseAnd %v4uint %23 %20 - %25 = OpExtInst %v4uint %14 UClamp %24 %21 %22 - %9 = OpIEqual %v4bool %24 %25 - OpStore %res %9 +%isNormal_863dcd = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %30 + %22 = OpCompositeConstruct %v4uint %uint_133693440 %uint_133693440 %uint_133693440 %uint_133693440 + %23 = OpCompositeConstruct %v4uint %uint_524288 %uint_524288 %uint_524288 %uint_524288 + %24 = OpCompositeConstruct %v4uint %uint_133169152 %uint_133169152 %uint_133169152 %uint_133169152 + %25 = OpBitcast %v4uint %8 + %26 = OpBitwiseAnd %v4uint %25 %22 + %27 = OpExtInst %v4uint %16 UClamp %26 %23 %24 + %13 = OpIEqual %v4bool %26 %27 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %isNormal_863dcd - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %31 +%tint_symbol = OpFunctionParameter %v4float %34 = OpLabel - %35 = OpFunctionCall %void %isNormal_863dcd + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %37 = OpLabel +%vertex_main = OpFunction %void None %9 + %36 = OpLabel + OpStore %tint_pointsize %float_1 %38 = OpFunctionCall %void %isNormal_863dcd + %39 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %41 = OpLabel + %42 = OpFunctionCall %void %isNormal_863dcd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %44 = OpLabel + %45 = OpFunctionCall %void %isNormal_863dcd OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl index f81cfef5e3..d2a39bda22 100644 --- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNormal_863dcd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_863dcd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl index cb819a6868..97556c1881 100644 --- a/test/intrinsics/gen/isNormal/b00ab1.wgsl +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl @@ -27,8 +27,9 @@ fn isNormal_b00ab1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_b00ab1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl index 8f1c9dd707..898dd73597 100644 --- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNormal_b00ab1() { bool2 res = isnormal(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNormal_b00ab1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm index 392e6274aa..0de7bf9248 100644 --- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm @@ -1,67 +1,83 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 48 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %18 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNormal_b00ab1 "isNormal_b00ab1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %uint = OpTypeInt 32 0 %uint_133693440 = OpConstant %uint 133693440 %uint_524288 = OpConstant %uint 524288 %uint_133169152 = OpConstant %uint 133169152 %v2uint = OpTypeVector %uint 2 %_ptr_Function_v2bool = OpTypePointer Function %v2bool - %28 = OpConstantNull %v2bool + %32 = OpConstantNull %v2bool + %33 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isNormal_b00ab1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2bool Function %28 - %20 = OpCompositeConstruct %v2uint %uint_133693440 %uint_133693440 - %21 = OpCompositeConstruct %v2uint %uint_524288 %uint_524288 - %22 = OpCompositeConstruct %v2uint %uint_133169152 %uint_133169152 - %23 = OpBitcast %v2uint %13 - %24 = OpBitwiseAnd %v2uint %23 %20 - %25 = OpExtInst %v2uint %14 UClamp %24 %21 %22 - %9 = OpIEqual %v2bool %24 %25 - OpStore %res %9 +%isNormal_b00ab1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %32 + %24 = OpCompositeConstruct %v2uint %uint_133693440 %uint_133693440 + %25 = OpCompositeConstruct %v2uint %uint_524288 %uint_524288 + %26 = OpCompositeConstruct %v2uint %uint_133169152 %uint_133169152 + %27 = OpBitcast %v2uint %17 + %28 = OpBitwiseAnd %v2uint %27 %24 + %29 = OpExtInst %v2uint %18 UClamp %28 %25 %26 + %13 = OpIEqual %v2bool %28 %29 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %30 = OpLabel +%tint_symbol_2 = OpFunction %void None %33 +%tint_symbol = OpFunctionParameter %v4float + %36 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %38 = OpLabel OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %isNormal_b00ab1 + %40 = OpFunctionCall %void %isNormal_b00ab1 + %41 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %34 = OpLabel - %35 = OpFunctionCall %void %isNormal_b00ab1 +%fragment_main = OpFunction %void None %9 + %43 = OpLabel + %44 = OpFunctionCall %void %isNormal_b00ab1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %37 = OpLabel - %38 = OpFunctionCall %void %isNormal_b00ab1 +%compute_main = OpFunction %void None %9 + %46 = OpLabel + %47 = OpFunctionCall %void %isNormal_b00ab1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl index c14e06d70e..e1e5cb41c0 100644 --- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNormal_b00ab1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_b00ab1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl index 50c11aae0b..3374630a23 100644 --- a/test/intrinsics/gen/isNormal/c286b7.wgsl +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl @@ -27,8 +27,9 @@ fn isNormal_c286b7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_c286b7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl index 26fc3c4c76..e7bac05a89 100644 --- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNormal_c286b7() { bool3 res = isnormal(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNormal_c286b7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm index 4ae8199242..657c0d4102 100644 --- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm @@ -1,67 +1,83 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 48 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %18 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNormal_c286b7 "isNormal_c286b7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 %v3float = OpTypeVector %float 3 - %13 = OpConstantNull %v3float + %17 = OpConstantNull %v3float %uint = OpTypeInt 32 0 %uint_133693440 = OpConstant %uint 133693440 %uint_524288 = OpConstant %uint 524288 %uint_133169152 = OpConstant %uint 133169152 %v3uint = OpTypeVector %uint 3 %_ptr_Function_v3bool = OpTypePointer Function %v3bool - %28 = OpConstantNull %v3bool + %32 = OpConstantNull %v3bool + %33 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%isNormal_c286b7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3bool Function %28 - %20 = OpCompositeConstruct %v3uint %uint_133693440 %uint_133693440 %uint_133693440 - %21 = OpCompositeConstruct %v3uint %uint_524288 %uint_524288 %uint_524288 - %22 = OpCompositeConstruct %v3uint %uint_133169152 %uint_133169152 %uint_133169152 - %23 = OpBitcast %v3uint %13 - %24 = OpBitwiseAnd %v3uint %23 %20 - %25 = OpExtInst %v3uint %14 UClamp %24 %21 %22 - %9 = OpIEqual %v3bool %24 %25 - OpStore %res %9 +%isNormal_c286b7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %32 + %24 = OpCompositeConstruct %v3uint %uint_133693440 %uint_133693440 %uint_133693440 + %25 = OpCompositeConstruct %v3uint %uint_524288 %uint_524288 %uint_524288 + %26 = OpCompositeConstruct %v3uint %uint_133169152 %uint_133169152 %uint_133169152 + %27 = OpBitcast %v3uint %17 + %28 = OpBitwiseAnd %v3uint %27 %24 + %29 = OpExtInst %v3uint %18 UClamp %28 %25 %26 + %13 = OpIEqual %v3bool %28 %29 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %30 = OpLabel +%tint_symbol_2 = OpFunction %void None %33 +%tint_symbol = OpFunctionParameter %v4float + %36 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %38 = OpLabel OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %isNormal_c286b7 + %40 = OpFunctionCall %void %isNormal_c286b7 + %41 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %34 = OpLabel - %35 = OpFunctionCall %void %isNormal_c286b7 +%fragment_main = OpFunction %void None %9 + %43 = OpLabel + %44 = OpFunctionCall %void %isNormal_c286b7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %37 = OpLabel - %38 = OpFunctionCall %void %isNormal_c286b7 +%compute_main = OpFunction %void None %9 + %46 = OpLabel + %47 = OpFunctionCall %void %isNormal_c286b7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl index e8b0e2bb17..5593263f4f 100644 --- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNormal_c286b7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_c286b7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl index 9997d8c09b..0682a4fd66 100644 --- a/test/intrinsics/gen/isNormal/c6e880.wgsl +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl @@ -27,8 +27,9 @@ fn isNormal_c6e880() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_c6e880(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl index b8dda4e688..2df6a245b7 100644 --- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void isNormal_c6e880() { bool res = isnormal(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { isNormal_c6e880(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm index 85f21bbc39..10c9497068 100644 --- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm @@ -1,29 +1,37 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %isNormal_c6e880 "isNormal_c6e880" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %float_1 = OpConstant %float 1 %uint = OpTypeInt 32 0 @@ -31,30 +39,38 @@ %uint_524288 = OpConstant %uint 524288 %uint_133169152 = OpConstant %uint 133169152 %_ptr_Function_bool = OpTypePointer Function %bool - %22 = OpConstantNull %bool -%isNormal_c6e880 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %22 - %17 = OpBitcast %uint %float_1 - %18 = OpBitwiseAnd %uint %17 %uint_133693440 - %19 = OpExtInst %uint %12 UClamp %18 %uint_524288 %uint_133169152 - %9 = OpIEqual %bool %18 %19 - OpStore %res %9 + %26 = OpConstantNull %bool + %27 = OpTypeFunction %void %v4float +%isNormal_c6e880 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %26 + %21 = OpBitcast %uint %float_1 + %22 = OpBitwiseAnd %uint %21 %uint_133693440 + %23 = OpExtInst %uint %16 UClamp %22 %uint_524288 %uint_133169152 + %13 = OpIEqual %bool %22 %23 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %isNormal_c6e880 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %27 = OpLabel - %28 = OpFunctionCall %void %isNormal_c6e880 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float %30 = OpLabel - %31 = OpFunctionCall %void %isNormal_c6e880 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %32 = OpLabel + OpStore %tint_pointsize %float_1 + %33 = OpFunctionCall %void %isNormal_c6e880 + %34 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %36 = OpLabel + %37 = OpFunctionCall %void %isNormal_c6e880 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %39 = OpLabel + %40 = OpFunctionCall %void %isNormal_c6e880 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl index 5218aec46e..8cef6c2f07 100644 --- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn isNormal_c6e880() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { isNormal_c6e880(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl index 46ca343674..28840f0d0f 100644 --- a/test/intrinsics/gen/ldexp/2cb32a.wgsl +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl @@ -27,8 +27,9 @@ fn ldexp_2cb32a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_2cb32a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl index 60b2ca18fb..756a4aae63 100644 --- a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_2cb32a() { float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_2cb32a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm index 7d726b1bd8..7c0ec55178 100644 --- a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm @@ -1,56 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_2cb32a "ldexp_2cb32a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %15 = OpConstantNull %v3uint + %19 = OpConstantNull %v3uint %_ptr_Function_v3float = OpTypePointer Function %v3float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ldexp_2cb32a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Ldexp %12 %15 - OpStore %res %9 +%ldexp_2cb32a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Ldexp %16 %19 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %ldexp_2cb32a + %29 = OpFunctionCall %void %ldexp_2cb32a + %30 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_2cb32a +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ldexp_2cb32a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %ldexp_2cb32a +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %ldexp_2cb32a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl index 7a2d880bc0..61a047c2ca 100644 --- a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_2cb32a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_2cb32a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl index 721a215624..aa6f4bba16 100644 --- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl @@ -27,8 +27,9 @@ fn ldexp_4d6f6d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_4d6f6d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl index 34a11dc741..6826179681 100644 --- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_4d6f6d() { float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_4d6f6d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm index 15284e6e39..63d2d7408d 100644 --- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm @@ -1,56 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_4d6f6d "ldexp_4d6f6d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %15 = OpConstantNull %v4uint + %17 = OpConstantNull %v4uint %_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ldexp_4d6f6d = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Ldexp %12 %15 - OpStore %res %9 +%ldexp_4d6f6d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Ldexp %8 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %ldexp_4d6f6d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_4d6f6d + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %26 = OpLabel +%vertex_main = OpFunction %void None %9 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %ldexp_4d6f6d + %28 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %ldexp_4d6f6d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %ldexp_4d6f6d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl index 50dc3073fb..e3a75a720e 100644 --- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_4d6f6d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_4d6f6d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl index f3de6a9081..9d405fedb9 100644 --- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl @@ -27,8 +27,9 @@ fn ldexp_7bc2fd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_7bc2fd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl index b5ec607bae..4d473cae68 100644 --- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_7bc2fd() { float2 res = ldexp(float2(0.0f, 0.0f), uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_7bc2fd(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm index e91a0d41ae..2c1651761c 100644 --- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm @@ -1,56 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_7bc2fd "ldexp_7bc2fd" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %15 = OpConstantNull %v2uint + %19 = OpConstantNull %v2uint %_ptr_Function_v2float = OpTypePointer Function %v2float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ldexp_7bc2fd = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Ldexp %12 %15 - OpStore %res %9 +%ldexp_7bc2fd = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Ldexp %16 %19 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %ldexp_7bc2fd + %29 = OpFunctionCall %void %ldexp_7bc2fd + %30 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_7bc2fd +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ldexp_7bc2fd OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %ldexp_7bc2fd +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %ldexp_7bc2fd OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl index 3f6c48ec50..1b0fbfaf4b 100644 --- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_7bc2fd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_7bc2fd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl index 54dd6900c0..ba74142fb3 100644 --- a/test/intrinsics/gen/ldexp/a31cdc.wgsl +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl @@ -27,8 +27,9 @@ fn ldexp_a31cdc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_a31cdc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl index a099927b12..7ee93e55dc 100644 --- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_a31cdc() { float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_a31cdc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl index a535583d9f..12ec93616b 100644 --- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ldexp_a31cdc() { float3 res = ldexp(float3(), int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ldexp_a31cdc(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm index 07a38ebeda..0e0b939b87 100644 --- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm @@ -1,56 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_a31cdc "ldexp_a31cdc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %15 = OpConstantNull %v3int + %19 = OpConstantNull %v3int %_ptr_Function_v3float = OpTypePointer Function %v3float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ldexp_a31cdc = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Ldexp %12 %15 - OpStore %res %9 +%ldexp_a31cdc = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Ldexp %16 %19 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %ldexp_a31cdc + %29 = OpFunctionCall %void %ldexp_a31cdc + %30 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_a31cdc +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ldexp_a31cdc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %ldexp_a31cdc +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %ldexp_a31cdc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl index 788cab232a..7c995cc4af 100644 --- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_a31cdc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_a31cdc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl index 7a5eef17db..9459f7a30e 100644 --- a/test/intrinsics/gen/ldexp/abd718.wgsl +++ b/test/intrinsics/gen/ldexp/abd718.wgsl @@ -27,8 +27,9 @@ fn ldexp_abd718() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_abd718(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl index af7d67b934..d5aaaa976c 100644 --- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_abd718() { float2 res = ldexp(float2(0.0f, 0.0f), int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_abd718(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl index 86338d3227..2fa4009f29 100644 --- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ldexp_abd718() { float2 res = ldexp(float2(), int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ldexp_abd718(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm index 5d84f62c8e..64f614c384 100644 --- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm @@ -1,56 +1,72 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_abd718 "ldexp_abd718" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %15 = OpConstantNull %v2int + %19 = OpConstantNull %v2int %_ptr_Function_v2float = OpTypePointer Function %v2float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ldexp_abd718 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Ldexp %12 %15 - OpStore %res %9 +%ldexp_abd718 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Ldexp %16 %19 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %ldexp_abd718 + %29 = OpFunctionCall %void %ldexp_abd718 + %30 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_abd718 +%fragment_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ldexp_abd718 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %26 = OpLabel - %27 = OpFunctionCall %void %ldexp_abd718 +%compute_main = OpFunction %void None %9 + %35 = OpLabel + %36 = OpFunctionCall %void %ldexp_abd718 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl index 8d38ecd799..b130fdc7ff 100644 --- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_abd718() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_abd718(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl index 12d88ce0df..9ff2fdcdf4 100644 --- a/test/intrinsics/gen/ldexp/cc9cde.wgsl +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl @@ -27,8 +27,9 @@ fn ldexp_cc9cde() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_cc9cde(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl index 8134010096..a624dc7eb8 100644 --- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_cc9cde() { float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_cc9cde(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl index 59232fddfc..c8a2dc950c 100644 --- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ldexp_cc9cde() { float4 res = ldexp(float4(), int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ldexp_cc9cde(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm index 085dc1a7c4..9fabf4437d 100644 --- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm @@ -1,56 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_cc9cde "ldexp_cc9cde" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %15 = OpConstantNull %v4int + %17 = OpConstantNull %v4int %_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%ldexp_cc9cde = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Ldexp %12 %15 - OpStore %res %9 +%ldexp_cc9cde = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Ldexp %8 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %ldexp_cc9cde - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_cc9cde + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %26 = OpLabel +%vertex_main = OpFunction %void None %9 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %ldexp_cc9cde + %28 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %ldexp_cc9cde + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %ldexp_cc9cde OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl index 5db48cec11..8e51bc34d5 100644 --- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_cc9cde() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_cc9cde(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl index 97f4987f5a..77b71bb90e 100644 --- a/test/intrinsics/gen/ldexp/db8b49.wgsl +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl @@ -27,8 +27,9 @@ fn ldexp_db8b49() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_db8b49(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl index db60414d1d..4b5c0544f0 100644 --- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_db8b49() { float res = ldexp(1.0f, 1); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_db8b49(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl index 08368a36db..cc7fbc1250 100644 --- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ldexp_db8b49() { float res = ldexp(1.0f, 1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ldexp_db8b49(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm index fd415e68bd..129572245f 100644 --- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_db8b49 "ldexp_db8b49" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_float = OpTypePointer Function %float -%ldexp_db8b49 = OpFunction %void None %5 - %8 = OpLabel + %20 = OpTypeFunction %void %v4float +%ldexp_db8b49 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Ldexp %float_1 %int_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Ldexp %float_1 %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %ldexp_db8b49 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %ldexp_db8b49 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_db8b49 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %ldexp_db8b49 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %ldexp_db8b49 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ldexp_db8b49 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl index cc84308884..cc71fc38e5 100644 --- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_db8b49() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_db8b49(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl index dfe420aad9..72fef93e60 100644 --- a/test/intrinsics/gen/ldexp/f54ff2.wgsl +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl @@ -27,8 +27,9 @@ fn ldexp_f54ff2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_f54ff2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl index d674b8dc86..c20a999506 100644 --- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void ldexp_f54ff2() { float res = ldexp(1.0f, 1u); } -void vertex_main() { +tint_symbol vertex_main() { ldexp_f54ff2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl index 4980cea0cb..9cef87efe3 100644 --- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void ldexp_f54ff2() { float res = ldexp(1.0f, 1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { ldexp_f54ff2(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm index 6d449b0297..221b8182d5 100644 --- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %ldexp_f54ff2 "ldexp_f54ff2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_float = OpTypePointer Function %float -%ldexp_f54ff2 = OpFunction %void None %5 - %8 = OpLabel + %20 = OpTypeFunction %void %v4float +%ldexp_f54ff2 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Ldexp %float_1 %uint_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Ldexp %float_1 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %ldexp_f54ff2 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %ldexp_f54ff2 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %ldexp_f54ff2 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %ldexp_f54ff2 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %ldexp_f54ff2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %ldexp_f54ff2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl index aea15a05a3..37e584c83a 100644 --- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn ldexp_f54ff2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { ldexp_f54ff2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/056071.wgsl b/test/intrinsics/gen/length/056071.wgsl index 61c6111e4c..1684a87bbc 100644 --- a/test/intrinsics/gen/length/056071.wgsl +++ b/test/intrinsics/gen/length/056071.wgsl @@ -27,8 +27,9 @@ fn length_056071() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_056071(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.hlsl b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl index a3ffa2ac31..3c0448da6b 100644 --- a/test/intrinsics/gen/length/056071.wgsl.expected.hlsl +++ b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void length_056071() { float res = length(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { length_056071(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.msl b/test/intrinsics/gen/length/056071.wgsl.expected.msl index 5ea9ae94b5..bddb507941 100644 --- a/test/intrinsics/gen/length/056071.wgsl.expected.msl +++ b/test/intrinsics/gen/length/056071.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void length_056071() { float res = length(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { length_056071(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.spvasm b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm index 8fd89832e0..aa71be33e8 100644 --- a/test/intrinsics/gen/length/056071.wgsl.expected.spvasm +++ b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %length_056071 "length_056071" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_float = OpTypePointer Function %float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%length_056071 = OpFunction %void None %5 - %8 = OpLabel +%length_056071 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Length %12 - OpStore %res %9 + %13 = OpExtInst %float %14 Length %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %length_056071 + %26 = OpFunctionCall %void %length_056071 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %length_056071 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %length_056071 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %length_056071 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %length_056071 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.wgsl b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl index 76b3aa824b..fdf20a4175 100644 --- a/test/intrinsics/gen/length/056071.wgsl.expected.wgsl +++ b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn length_056071() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_056071(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/602a17.wgsl b/test/intrinsics/gen/length/602a17.wgsl index 6f5d3b5aa2..7db07ab381 100644 --- a/test/intrinsics/gen/length/602a17.wgsl +++ b/test/intrinsics/gen/length/602a17.wgsl @@ -27,8 +27,9 @@ fn length_602a17() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_602a17(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl index db461f8412..c9fe718b1f 100644 --- a/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void length_602a17() { float res = length(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { length_602a17(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm index 68516f0817..aec037424f 100644 --- a/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %length_602a17 "length_602a17" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%length_602a17 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%length_602a17 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Length %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Length %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %length_602a17 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %length_602a17 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %length_602a17 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %length_602a17 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %length_602a17 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %length_602a17 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl index 2b6b9e9745..c277392873 100644 --- a/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn length_602a17() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_602a17(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/afde8b.wgsl b/test/intrinsics/gen/length/afde8b.wgsl index fde4834af0..ea24ab266c 100644 --- a/test/intrinsics/gen/length/afde8b.wgsl +++ b/test/intrinsics/gen/length/afde8b.wgsl @@ -27,8 +27,9 @@ fn length_afde8b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_afde8b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl index 005dc5a814..b0b25974a2 100644 --- a/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void length_afde8b() { float res = length(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { length_afde8b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl index 56514b1c01..19022642ce 100644 --- a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void length_afde8b() { float res = length(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { length_afde8b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm index 70f5d76a05..73d97a8e45 100644 --- a/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %length_afde8b "length_afde8b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_float = OpTypePointer Function %float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%length_afde8b = OpFunction %void None %5 - %8 = OpLabel +%length_afde8b = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Length %12 - OpStore %res %9 + %13 = OpExtInst %float %14 Length %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %length_afde8b + %26 = OpFunctionCall %void %length_afde8b + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %length_afde8b +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %length_afde8b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %length_afde8b +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %length_afde8b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl index 052f0afd45..0630c3a6f9 100644 --- a/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn length_afde8b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_afde8b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/becebf.wgsl b/test/intrinsics/gen/length/becebf.wgsl index 447d82ee0f..b3db3c506e 100644 --- a/test/intrinsics/gen/length/becebf.wgsl +++ b/test/intrinsics/gen/length/becebf.wgsl @@ -27,8 +27,9 @@ fn length_becebf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_becebf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl index a1c4197fba..c7daa539fe 100644 --- a/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void length_becebf() { float res = length(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { length_becebf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.msl b/test/intrinsics/gen/length/becebf.wgsl.expected.msl index a63f31af01..9cd6341109 100644 --- a/test/intrinsics/gen/length/becebf.wgsl.expected.msl +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void length_becebf() { float res = length(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { length_becebf(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm index 48be6d3443..4b20f995e3 100644 --- a/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %length_becebf "length_becebf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_float = OpTypePointer Function %float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%length_becebf = OpFunction %void None %5 - %8 = OpLabel +%length_becebf = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Length %12 - OpStore %res %9 + %13 = OpExtInst %float %14 Length %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %length_becebf - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %length_becebf + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %length_becebf + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %length_becebf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %length_becebf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl index c8a2c423e5..0abe2722e6 100644 --- a/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn length_becebf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { length_becebf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/3da25a.wgsl b/test/intrinsics/gen/log/3da25a.wgsl index 07716b2087..14a4ada2ef 100644 --- a/test/intrinsics/gen/log/3da25a.wgsl +++ b/test/intrinsics/gen/log/3da25a.wgsl @@ -27,8 +27,9 @@ fn log_3da25a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_3da25a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl index 7a247e39b4..d2ee1f4846 100644 --- a/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log_3da25a() { float4 res = log(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { log_3da25a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl index ff81127568..87551df830 100644 --- a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log_3da25a() { float4 res = log(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log_3da25a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm index 3d66145f48..de8964aba9 100644 --- a/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log_3da25a "log_3da25a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %log_3da25a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Log %12 - OpStore %res %9 + %log_3da25a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Log %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %log_3da25a - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %log_3da25a + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %log_3da25a + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %log_3da25a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %log_3da25a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl index 452e71cfc0..c143d5e360 100644 --- a/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log_3da25a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_3da25a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/7114a6.wgsl b/test/intrinsics/gen/log/7114a6.wgsl index bac8f95462..242a19ab2d 100644 --- a/test/intrinsics/gen/log/7114a6.wgsl +++ b/test/intrinsics/gen/log/7114a6.wgsl @@ -27,8 +27,9 @@ fn log_7114a6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_7114a6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl index e1f96d23d0..81658bbf3c 100644 --- a/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log_7114a6() { float res = log(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { log_7114a6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl index e052391586..ca217059a1 100644 --- a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log_7114a6() { float res = log(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log_7114a6(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm index fd0a41cf8d..20694039ea 100644 --- a/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log_7114a6 "log_7114a6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %log_7114a6 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %log_7114a6 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Log %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Log %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %log_7114a6 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %log_7114a6 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %log_7114a6 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %log_7114a6 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %log_7114a6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %log_7114a6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl index 9887a633bb..fd87d0317e 100644 --- a/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log_7114a6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_7114a6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/b2ce28.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl index 540615d9c9..2dd933c59c 100644 --- a/test/intrinsics/gen/log/b2ce28.wgsl +++ b/test/intrinsics/gen/log/b2ce28.wgsl @@ -27,8 +27,9 @@ fn log_b2ce28() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_b2ce28(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl index 0e6d75d531..63b63dd28e 100644 --- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log_b2ce28() { float2 res = log(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { log_b2ce28(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl index 69f048aae4..43777d4c2f 100644 --- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log_b2ce28() { float2 res = log(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log_b2ce28(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm index 3615a64151..94e3fdabcb 100644 --- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log_b2ce28 "log_b2ce28" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %log_b2ce28 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Log %12 - OpStore %res %9 + %log_b2ce28 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Log %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %log_b2ce28 + %26 = OpFunctionCall %void %log_b2ce28 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %log_b2ce28 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %log_b2ce28 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %log_b2ce28 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %log_b2ce28 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl index 3e98760184..0eb2862a02 100644 --- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log_b2ce28() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_b2ce28(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/f4c570.wgsl b/test/intrinsics/gen/log/f4c570.wgsl index 70a5b35ff5..fe34013262 100644 --- a/test/intrinsics/gen/log/f4c570.wgsl +++ b/test/intrinsics/gen/log/f4c570.wgsl @@ -27,8 +27,9 @@ fn log_f4c570() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_f4c570(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl index 92b5439d50..fd8c5abb62 100644 --- a/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log_f4c570() { float3 res = log(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { log_f4c570(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl index e1b3061479..63442469bb 100644 --- a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log_f4c570() { float3 res = log(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log_f4c570(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm index 367cee2770..69b5d67671 100644 --- a/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log_f4c570 "log_f4c570" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %log_f4c570 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Log %12 - OpStore %res %9 + %log_f4c570 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Log %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %log_f4c570 + %26 = OpFunctionCall %void %log_f4c570 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %log_f4c570 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %log_f4c570 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %log_f4c570 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %log_f4c570 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl index 57a2f172f6..7b61578a88 100644 --- a/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log_f4c570() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log_f4c570(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/4036ed.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl index 12a5124114..4a16c524dc 100644 --- a/test/intrinsics/gen/log2/4036ed.wgsl +++ b/test/intrinsics/gen/log2/4036ed.wgsl @@ -27,8 +27,9 @@ fn log2_4036ed() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_4036ed(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl index 64d6c003cc..8cf1e318f6 100644 --- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log2_4036ed() { float res = log2(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { log2_4036ed(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl index 30658f2a21..49dc07a9a4 100644 --- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log2_4036ed() { float res = log2(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log2_4036ed(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm index 25873c2a4c..79365bfdc7 100644 --- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log2_4036ed "log2_4036ed" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%log2_4036ed = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%log2_4036ed = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Log2 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Log2 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %log2_4036ed - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %log2_4036ed - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %log2_4036ed + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %log2_4036ed + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %log2_4036ed + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %log2_4036ed OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl index c188875655..6e2a7612ac 100644 --- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log2_4036ed() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_4036ed(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/902988.wgsl b/test/intrinsics/gen/log2/902988.wgsl index 37fa4358bb..fb66cde10d 100644 --- a/test/intrinsics/gen/log2/902988.wgsl +++ b/test/intrinsics/gen/log2/902988.wgsl @@ -27,8 +27,9 @@ fn log2_902988() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_902988(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl index cf1503fa3a..36b4440c93 100644 --- a/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log2_902988() { float4 res = log2(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { log2_902988(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.msl b/test/intrinsics/gen/log2/902988.wgsl.expected.msl index 4a9bd89c53..d7828e6df7 100644 --- a/test/intrinsics/gen/log2/902988.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log2_902988() { float4 res = log2(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log2_902988(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm index bab1daa121..094a8850ef 100644 --- a/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log2_902988 "log2_902988" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%log2_902988 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Log2 %12 - OpStore %res %9 +%log2_902988 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Log2 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %log2_902988 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %log2_902988 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %log2_902988 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %log2_902988 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %log2_902988 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl index 9f4b264493..290a85e5ad 100644 --- a/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log2_902988() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_902988(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/adb233.wgsl b/test/intrinsics/gen/log2/adb233.wgsl index 54b7dc356f..e3e72b5987 100644 --- a/test/intrinsics/gen/log2/adb233.wgsl +++ b/test/intrinsics/gen/log2/adb233.wgsl @@ -27,8 +27,9 @@ fn log2_adb233() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_adb233(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl index d78b7131f7..d12c23f4ce 100644 --- a/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log2_adb233() { float3 res = log2(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { log2_adb233(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl index 8e122aa371..ee68aabbb2 100644 --- a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log2_adb233() { float3 res = log2(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log2_adb233(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm index 60d3c54eaf..166e27f916 100644 --- a/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log2_adb233 "log2_adb233" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%log2_adb233 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Log2 %12 - OpStore %res %9 +%log2_adb233 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Log2 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %log2_adb233 + %26 = OpFunctionCall %void %log2_adb233 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %log2_adb233 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %log2_adb233 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %log2_adb233 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %log2_adb233 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl index 1b6e0ca52d..aaac3324e1 100644 --- a/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log2_adb233() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_adb233(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/aea659.wgsl b/test/intrinsics/gen/log2/aea659.wgsl index b9d25e4dad..6b6d5f4729 100644 --- a/test/intrinsics/gen/log2/aea659.wgsl +++ b/test/intrinsics/gen/log2/aea659.wgsl @@ -27,8 +27,9 @@ fn log2_aea659() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_aea659(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl index d4bf6edf33..c14b45ac79 100644 --- a/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void log2_aea659() { float2 res = log2(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { log2_aea659(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl index fa4ade208c..4e44b11399 100644 --- a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void log2_aea659() { float2 res = log2(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { log2_aea659(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm index ac0c81598c..7e17b05f8e 100644 --- a/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %log2_aea659 "log2_aea659" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%log2_aea659 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Log2 %12 - OpStore %res %9 +%log2_aea659 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Log2 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %log2_aea659 + %26 = OpFunctionCall %void %log2_aea659 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %log2_aea659 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %log2_aea659 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %log2_aea659 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %log2_aea659 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl index f21cead4d0..05a7f5f65b 100644 --- a/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn log2_aea659() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { log2_aea659(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/0c0aae.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl index e68b5020cf..36e2239076 100644 --- a/test/intrinsics/gen/max/0c0aae.wgsl +++ b/test/intrinsics/gen/max/0c0aae.wgsl @@ -27,8 +27,9 @@ fn max_0c0aae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_0c0aae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl index 9190770d4c..e4b23d4766 100644 --- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_0c0aae() { uint res = max(1u, 1u); } -void vertex_main() { +tint_symbol vertex_main() { max_0c0aae(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl index c70f54675d..9ebf54afed 100644 --- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_0c0aae() { uint res = max(1u, 1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_0c0aae(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm index 16889df796..cc586bbb41 100644 --- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_0c0aae "max_0c0aae" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_uint = OpTypePointer Function %uint - %15 = OpConstantNull %uint + %19 = OpConstantNull %uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_0c0aae = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %15 - %9 = OpExtInst %uint %11 UMax %uint_1 %uint_1 - OpStore %res %9 + %max_0c0aae = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %19 + %13 = OpExtInst %uint %15 UMax %uint_1 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_0c0aae + %27 = OpFunctionCall %void %max_0c0aae + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_0c0aae +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_0c0aae OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_0c0aae +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_0c0aae OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl index 911ceb08f1..5ef8934b13 100644 --- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_0c0aae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_0c0aae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/25eafe.wgsl b/test/intrinsics/gen/max/25eafe.wgsl index 1662e9fb93..6674302863 100644 --- a/test/intrinsics/gen/max/25eafe.wgsl +++ b/test/intrinsics/gen/max/25eafe.wgsl @@ -27,8 +27,9 @@ fn max_25eafe() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_25eafe(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl index fbd6119215..21ad0f5740 100644 --- a/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_25eafe() { int3 res = max(int3(0, 0, 0), int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { max_25eafe(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl index 42f0ea3e9d..b8eca1d5de 100644 --- a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_25eafe() { int3 res = max(int3(), int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_25eafe(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm index 2e5b431563..9c17396237 100644 --- a/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_25eafe "max_25eafe" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %13 = OpConstantNull %v3int + %17 = OpConstantNull %v3int %_ptr_Function_v3int = OpTypePointer Function %v3int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_25eafe = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %13 - %9 = OpExtInst %v3int %12 SMax %13 %13 - OpStore %res %9 + %max_25eafe = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %17 + %13 = OpExtInst %v3int %16 SMax %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_25eafe + %27 = OpFunctionCall %void %max_25eafe + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_25eafe +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_25eafe OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_25eafe +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_25eafe OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl index 7f7ed4657a..bc18138cd6 100644 --- a/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_25eafe() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_25eafe(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/320815.wgsl b/test/intrinsics/gen/max/320815.wgsl index 0e5a4268f8..6c14e5b226 100644 --- a/test/intrinsics/gen/max/320815.wgsl +++ b/test/intrinsics/gen/max/320815.wgsl @@ -27,8 +27,9 @@ fn max_320815() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_320815(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.hlsl b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl index 454bb3a4fd..d4abc9e53d 100644 --- a/test/intrinsics/gen/max/320815.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_320815() { uint2 res = max(uint2(0u, 0u), uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { max_320815(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.msl b/test/intrinsics/gen/max/320815.wgsl.expected.msl index 4f151c198e..9ecdcb9aaa 100644 --- a/test/intrinsics/gen/max/320815.wgsl.expected.msl +++ b/test/intrinsics/gen/max/320815.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_320815() { uint2 res = max(uint2(), uint2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_320815(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.spvasm b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm index aaac67ee5c..24307bd4db 100644 --- a/test/intrinsics/gen/max/320815.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_320815 "max_320815" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %13 = OpConstantNull %v2uint + %17 = OpConstantNull %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_320815 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2uint Function %13 - %9 = OpExtInst %v2uint %12 UMax %13 %13 - OpStore %res %9 + %max_320815 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %17 + %13 = OpExtInst %v2uint %16 UMax %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_320815 + %27 = OpFunctionCall %void %max_320815 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_320815 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_320815 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_320815 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_320815 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.wgsl b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl index f99eb40a2f..c845ac3ea8 100644 --- a/test/intrinsics/gen/max/320815.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_320815() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_320815(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/44a39d.wgsl b/test/intrinsics/gen/max/44a39d.wgsl index 1767a3d464..ba199cc864 100644 --- a/test/intrinsics/gen/max/44a39d.wgsl +++ b/test/intrinsics/gen/max/44a39d.wgsl @@ -27,8 +27,9 @@ fn max_44a39d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_44a39d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl index 5b3fdc306e..d0932063d3 100644 --- a/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_44a39d() { float res = max(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { max_44a39d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl index 4dc7f9cb6b..ba3fcf1063 100644 --- a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_44a39d() { float res = fmax(1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_44a39d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm index 19bb7a410f..b2775c623a 100644 --- a/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_44a39d "max_44a39d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %max_44a39d = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %max_44a39d = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 NMax %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 NMax %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %max_44a39d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %max_44a39d - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %max_44a39d + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %max_44a39d + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %max_44a39d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_44a39d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl index d520c0634a..69580163d2 100644 --- a/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_44a39d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_44a39d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/453e04.wgsl b/test/intrinsics/gen/max/453e04.wgsl index 1ed4d30f4d..15807d4bf8 100644 --- a/test/intrinsics/gen/max/453e04.wgsl +++ b/test/intrinsics/gen/max/453e04.wgsl @@ -27,8 +27,9 @@ fn max_453e04() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_453e04(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl index 1500fa2346..d89a97bb02 100644 --- a/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_453e04() { uint4 res = max(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { max_453e04(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.msl b/test/intrinsics/gen/max/453e04.wgsl.expected.msl index 9704013d72..d8b12c678a 100644 --- a/test/intrinsics/gen/max/453e04.wgsl.expected.msl +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_453e04() { uint4 res = max(uint4(), uint4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_453e04(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm index c043630ab8..942578b467 100644 --- a/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_453e04 "max_453e04" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %13 = OpConstantNull %v4uint + %17 = OpConstantNull %v4uint %_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_453e04 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %13 - %9 = OpExtInst %v4uint %12 UMax %13 %13 - OpStore %res %9 + %max_453e04 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %17 + %13 = OpExtInst %v4uint %16 UMax %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_453e04 + %27 = OpFunctionCall %void %max_453e04 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_453e04 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_453e04 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_453e04 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_453e04 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl index 37ad8eb4dc..5549a7d84a 100644 --- a/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_453e04() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_453e04(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/462050.wgsl b/test/intrinsics/gen/max/462050.wgsl index 1e694e8f9c..8f5be929e9 100644 --- a/test/intrinsics/gen/max/462050.wgsl +++ b/test/intrinsics/gen/max/462050.wgsl @@ -27,8 +27,9 @@ fn max_462050() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_462050(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.hlsl b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl index cab3796c5a..3e0d5d4ba9 100644 --- a/test/intrinsics/gen/max/462050.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_462050() { float2 res = max(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { max_462050(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.msl b/test/intrinsics/gen/max/462050.wgsl.expected.msl index 073d8dfbdc..ef47fd2a21 100644 --- a/test/intrinsics/gen/max/462050.wgsl.expected.msl +++ b/test/intrinsics/gen/max/462050.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_462050() { float2 res = fmax(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_462050(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.spvasm b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm index 02f677907e..6a3f5957ed 100644 --- a/test/intrinsics/gen/max/462050.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_462050 "max_462050" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_462050 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 NMax %12 %12 - OpStore %res %9 + %max_462050 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 NMax %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %max_462050 + %26 = OpFunctionCall %void %max_462050 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %max_462050 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %max_462050 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %max_462050 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %max_462050 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.wgsl b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl index 07aa216a64..6edc8a50b7 100644 --- a/test/intrinsics/gen/max/462050.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_462050() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_462050(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/4883ac.wgsl b/test/intrinsics/gen/max/4883ac.wgsl index e8da7d262b..1cf81252c3 100644 --- a/test/intrinsics/gen/max/4883ac.wgsl +++ b/test/intrinsics/gen/max/4883ac.wgsl @@ -27,8 +27,9 @@ fn max_4883ac() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_4883ac(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl index d14a43deb6..4020fd7d1b 100644 --- a/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_4883ac() { float3 res = max(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { max_4883ac(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl index 05f76163f6..fc31548734 100644 --- a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_4883ac() { float3 res = fmax(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_4883ac(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm index 9af39250f9..497672ad85 100644 --- a/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_4883ac "max_4883ac" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_4883ac = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 NMax %12 %12 - OpStore %res %9 + %max_4883ac = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 NMax %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %max_4883ac + %26 = OpFunctionCall %void %max_4883ac + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %max_4883ac +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %max_4883ac OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %max_4883ac +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %max_4883ac OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl index a066ad5998..93c3a20292 100644 --- a/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_4883ac() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_4883ac(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/85e6bc.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl index a915f0d730..116c261c96 100644 --- a/test/intrinsics/gen/max/85e6bc.wgsl +++ b/test/intrinsics/gen/max/85e6bc.wgsl @@ -27,8 +27,9 @@ fn max_85e6bc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_85e6bc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl index 17f9ed7922..237e7efde6 100644 --- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_85e6bc() { int4 res = max(int4(0, 0, 0, 0), int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { max_85e6bc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl index 67c75e73cd..8606e9ab3c 100644 --- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_85e6bc() { int4 res = max(int4(), int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_85e6bc(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm index b3dd4cab45..2bd843e7d3 100644 --- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_85e6bc "max_85e6bc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %13 = OpConstantNull %v4int + %17 = OpConstantNull %v4int %_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_85e6bc = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %13 - %9 = OpExtInst %v4int %12 SMax %13 %13 - OpStore %res %9 + %max_85e6bc = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %17 + %13 = OpExtInst %v4int %16 SMax %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_85e6bc + %27 = OpFunctionCall %void %max_85e6bc + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_85e6bc +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_85e6bc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_85e6bc +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_85e6bc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl index 2055bb62e0..ed6e7f431a 100644 --- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_85e6bc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_85e6bc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/a93419.wgsl b/test/intrinsics/gen/max/a93419.wgsl index 18563379e0..e9c369267c 100644 --- a/test/intrinsics/gen/max/a93419.wgsl +++ b/test/intrinsics/gen/max/a93419.wgsl @@ -27,8 +27,9 @@ fn max_a93419() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_a93419(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl index 3701fa242d..92950d1761 100644 --- a/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_a93419() { float4 res = max(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { max_a93419(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.msl b/test/intrinsics/gen/max/a93419.wgsl.expected.msl index abe3fc60ac..056c4b870e 100644 --- a/test/intrinsics/gen/max/a93419.wgsl.expected.msl +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_a93419() { float4 res = fmax(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_a93419(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm index c65a59f7a6..affcf74a34 100644 --- a/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_a93419 "max_a93419" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_a93419 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 NMax %12 %12 - OpStore %res %9 + %max_a93419 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 NMax %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %max_a93419 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %max_a93419 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %max_a93419 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %max_a93419 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_a93419 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl index a278e21459..8124cbf2eb 100644 --- a/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_a93419() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_a93419(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/b1b73a.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl index 2cbe7db15c..18a03153cc 100644 --- a/test/intrinsics/gen/max/b1b73a.wgsl +++ b/test/intrinsics/gen/max/b1b73a.wgsl @@ -27,8 +27,9 @@ fn max_b1b73a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_b1b73a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl index 7dca442bc2..ab2d462102 100644 --- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_b1b73a() { uint3 res = max(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { max_b1b73a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl index 979f9d5b37..3dfa68cc38 100644 --- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_b1b73a() { uint3 res = max(uint3(), uint3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_b1b73a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm index 4296bae461..54cf5c4d11 100644 --- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_b1b73a "max_b1b73a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %13 = OpConstantNull %v3uint + %17 = OpConstantNull %v3uint %_ptr_Function_v3uint = OpTypePointer Function %v3uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_b1b73a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3uint Function %13 - %9 = OpExtInst %v3uint %12 UMax %13 %13 - OpStore %res %9 + %max_b1b73a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %17 + %13 = OpExtInst %v3uint %16 UMax %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_b1b73a + %27 = OpFunctionCall %void %max_b1b73a + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_b1b73a +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_b1b73a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_b1b73a +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_b1b73a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl index ff4689f737..d7a467d3ca 100644 --- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_b1b73a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_b1b73a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/ce7c30.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl index 6f44a08482..8a20376fa9 100644 --- a/test/intrinsics/gen/max/ce7c30.wgsl +++ b/test/intrinsics/gen/max/ce7c30.wgsl @@ -27,8 +27,9 @@ fn max_ce7c30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_ce7c30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl index 581614a611..7892ab47c0 100644 --- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_ce7c30() { int res = max(1, 1); } -void vertex_main() { +tint_symbol vertex_main() { max_ce7c30(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl index 125162cadd..4f300ff005 100644 --- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_ce7c30() { int res = max(1, 1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_ce7c30(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm index 83b18b420c..068d7d2f46 100644 --- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_ce7c30 "max_ce7c30" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_int = OpTypePointer Function %int - %15 = OpConstantNull %int + %19 = OpConstantNull %int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_ce7c30 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_int Function %15 - %9 = OpExtInst %int %11 SMax %int_1 %int_1 - OpStore %res %9 + %max_ce7c30 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %13 = OpExtInst %int %15 SMax %int_1 %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_ce7c30 + %27 = OpFunctionCall %void %max_ce7c30 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_ce7c30 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_ce7c30 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_ce7c30 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_ce7c30 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl index c682b34177..61ad5bf3da 100644 --- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_ce7c30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_ce7c30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/e8192f.wgsl b/test/intrinsics/gen/max/e8192f.wgsl index 2609dcb199..f093110bf9 100644 --- a/test/intrinsics/gen/max/e8192f.wgsl +++ b/test/intrinsics/gen/max/e8192f.wgsl @@ -27,8 +27,9 @@ fn max_e8192f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_e8192f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl index cda8e83577..8209b735d5 100644 --- a/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void max_e8192f() { int2 res = max(int2(0, 0), int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { max_e8192f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl index c6165c3861..e35eb468e3 100644 --- a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void max_e8192f() { int2 res = max(int2(), int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { max_e8192f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm index 676cac1b8a..d417a926f8 100644 --- a/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %max_e8192f "max_e8192f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %13 = OpConstantNull %v2int + %17 = OpConstantNull %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %max_e8192f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %13 - %9 = OpExtInst %v2int %12 SMax %13 %13 - OpStore %res %9 + %max_e8192f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %17 + %13 = OpExtInst %v2int %16 SMax %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %max_e8192f + %27 = OpFunctionCall %void %max_e8192f + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %max_e8192f +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %max_e8192f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %max_e8192f +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %max_e8192f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl index b5720fbd35..c552473a3b 100644 --- a/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn max_e8192f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { max_e8192f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/03c7e3.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl index 9b0727fa1b..5ebc08b2f5 100644 --- a/test/intrinsics/gen/min/03c7e3.wgsl +++ b/test/intrinsics/gen/min/03c7e3.wgsl @@ -27,8 +27,9 @@ fn min_03c7e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_03c7e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl index c4e4bbb7a5..18737320b2 100644 --- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_03c7e3() { int2 res = min(int2(0, 0), int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { min_03c7e3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl index ba682096c7..7ae789a2c7 100644 --- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_03c7e3() { int2 res = min(int2(), int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_03c7e3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm index a2d7d52a04..a303e593ff 100644 --- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_03c7e3 "min_03c7e3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %13 = OpConstantNull %v2int + %17 = OpConstantNull %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_03c7e3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %13 - %9 = OpExtInst %v2int %12 SMin %13 %13 - OpStore %res %9 + %min_03c7e3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %17 + %13 = OpExtInst %v2int %16 SMin %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_03c7e3 + %27 = OpFunctionCall %void %min_03c7e3 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_03c7e3 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_03c7e3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_03c7e3 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_03c7e3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl index 2098c208d8..945b9f1fe7 100644 --- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_03c7e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_03c7e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/0dc614.wgsl b/test/intrinsics/gen/min/0dc614.wgsl index 7f33995076..ad1e63d412 100644 --- a/test/intrinsics/gen/min/0dc614.wgsl +++ b/test/intrinsics/gen/min/0dc614.wgsl @@ -27,8 +27,9 @@ fn min_0dc614() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_0dc614(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl index 2916bb5c13..e3d5176817 100644 --- a/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_0dc614() { uint4 res = min(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { min_0dc614(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl index 0baef43d19..c50267db25 100644 --- a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_0dc614() { uint4 res = min(uint4(), uint4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_0dc614(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm index 52ba04ed03..eebe29b0d6 100644 --- a/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_0dc614 "min_0dc614" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %13 = OpConstantNull %v4uint + %17 = OpConstantNull %v4uint %_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_0dc614 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %13 - %9 = OpExtInst %v4uint %12 UMin %13 %13 - OpStore %res %9 + %min_0dc614 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %17 + %13 = OpExtInst %v4uint %16 UMin %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_0dc614 + %27 = OpFunctionCall %void %min_0dc614 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_0dc614 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_0dc614 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_0dc614 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_0dc614 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl index 5c1965ca86..c20ebc1852 100644 --- a/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_0dc614() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_0dc614(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/3941e1.wgsl b/test/intrinsics/gen/min/3941e1.wgsl index 4e741048fc..886dabfeaf 100644 --- a/test/intrinsics/gen/min/3941e1.wgsl +++ b/test/intrinsics/gen/min/3941e1.wgsl @@ -27,8 +27,9 @@ fn min_3941e1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_3941e1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl index f21aacfae3..ca5c4aa249 100644 --- a/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_3941e1() { int4 res = min(int4(0, 0, 0, 0), int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { min_3941e1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl index 25c94c3fc2..d7b455088e 100644 --- a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_3941e1() { int4 res = min(int4(), int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_3941e1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm index 1b3f0f3ce1..eacea371a0 100644 --- a/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_3941e1 "min_3941e1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %13 = OpConstantNull %v4int + %17 = OpConstantNull %v4int %_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_3941e1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %13 - %9 = OpExtInst %v4int %12 SMin %13 %13 - OpStore %res %9 + %min_3941e1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %17 + %13 = OpExtInst %v4int %16 SMin %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_3941e1 + %27 = OpFunctionCall %void %min_3941e1 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_3941e1 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_3941e1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_3941e1 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_3941e1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl index cd5ed890fc..4d46b41113 100644 --- a/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_3941e1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_3941e1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/46c5d3.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl index b1603fb113..f8733055ea 100644 --- a/test/intrinsics/gen/min/46c5d3.wgsl +++ b/test/intrinsics/gen/min/46c5d3.wgsl @@ -27,8 +27,9 @@ fn min_46c5d3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_46c5d3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl index fda2c28d37..7b463e170f 100644 --- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_46c5d3() { uint res = min(1u, 1u); } -void vertex_main() { +tint_symbol vertex_main() { min_46c5d3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl index 9d2021e016..60276ceba2 100644 --- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_46c5d3() { uint res = min(1u, 1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_46c5d3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm index 093c7c8e76..7a14bf53ae 100644 --- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_46c5d3 "min_46c5d3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_uint = OpTypePointer Function %uint - %15 = OpConstantNull %uint + %19 = OpConstantNull %uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_46c5d3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %15 - %9 = OpExtInst %uint %11 UMin %uint_1 %uint_1 - OpStore %res %9 + %min_46c5d3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %19 + %13 = OpExtInst %uint %15 UMin %uint_1 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_46c5d3 + %27 = OpFunctionCall %void %min_46c5d3 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_46c5d3 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_46c5d3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_46c5d3 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_46c5d3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl index 4792db1420..cd7f63abd6 100644 --- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_46c5d3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_46c5d3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/82b28f.wgsl b/test/intrinsics/gen/min/82b28f.wgsl index 3dc216d130..2e67e770c6 100644 --- a/test/intrinsics/gen/min/82b28f.wgsl +++ b/test/intrinsics/gen/min/82b28f.wgsl @@ -27,8 +27,9 @@ fn min_82b28f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_82b28f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl index 96cdb7268a..7e4e2ebd6e 100644 --- a/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_82b28f() { uint2 res = min(uint2(0u, 0u), uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { min_82b28f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl index c79d46648a..7bd80b5be6 100644 --- a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_82b28f() { uint2 res = min(uint2(), uint2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_82b28f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm index 869b476973..bd2f708e87 100644 --- a/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_82b28f "min_82b28f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %13 = OpConstantNull %v2uint + %17 = OpConstantNull %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_82b28f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2uint Function %13 - %9 = OpExtInst %v2uint %12 UMin %13 %13 - OpStore %res %9 + %min_82b28f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %17 + %13 = OpExtInst %v2uint %16 UMin %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_82b28f + %27 = OpFunctionCall %void %min_82b28f + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_82b28f +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_82b28f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_82b28f +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_82b28f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl index cd3d2a7016..c9daf7416e 100644 --- a/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_82b28f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_82b28f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/93cfc4.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl index af0896c2ab..937bfd5747 100644 --- a/test/intrinsics/gen/min/93cfc4.wgsl +++ b/test/intrinsics/gen/min/93cfc4.wgsl @@ -27,8 +27,9 @@ fn min_93cfc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_93cfc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl index c3d2e41034..fdb17d18c3 100644 --- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_93cfc4() { float3 res = min(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { min_93cfc4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl index 2333a21757..97dc1cedc3 100644 --- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_93cfc4() { float3 res = fmin(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_93cfc4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm index c4c3db9322..a2b6713574 100644 --- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_93cfc4 "min_93cfc4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_93cfc4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 NMin %12 %12 - OpStore %res %9 + %min_93cfc4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 NMin %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %min_93cfc4 + %26 = OpFunctionCall %void %min_93cfc4 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %min_93cfc4 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %min_93cfc4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %min_93cfc4 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %min_93cfc4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl index a285e0decb..fba1d8c02c 100644 --- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_93cfc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_93cfc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/a45171.wgsl b/test/intrinsics/gen/min/a45171.wgsl index 5c70dbad5d..c473ff77d5 100644 --- a/test/intrinsics/gen/min/a45171.wgsl +++ b/test/intrinsics/gen/min/a45171.wgsl @@ -27,8 +27,9 @@ fn min_a45171() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_a45171(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl index 7c4503eef5..6e28f6bda7 100644 --- a/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_a45171() { int3 res = min(int3(0, 0, 0), int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { min_a45171(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.msl b/test/intrinsics/gen/min/a45171.wgsl.expected.msl index 9b4cdd6c5e..42a9bf78e6 100644 --- a/test/intrinsics/gen/min/a45171.wgsl.expected.msl +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_a45171() { int3 res = min(int3(), int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_a45171(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm index 9b0d61174f..8f7b2f25f2 100644 --- a/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_a45171 "min_a45171" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %13 = OpConstantNull %v3int + %17 = OpConstantNull %v3int %_ptr_Function_v3int = OpTypePointer Function %v3int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_a45171 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %13 - %9 = OpExtInst %v3int %12 SMin %13 %13 - OpStore %res %9 + %min_a45171 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %17 + %13 = OpExtInst %v3int %16 SMin %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_a45171 + %27 = OpFunctionCall %void %min_a45171 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_a45171 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_a45171 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_a45171 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_a45171 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl index 4d10949536..43b43ae68a 100644 --- a/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_a45171() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_a45171(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/aa28ad.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl index 78ab7866de..0263ac01a6 100644 --- a/test/intrinsics/gen/min/aa28ad.wgsl +++ b/test/intrinsics/gen/min/aa28ad.wgsl @@ -27,8 +27,9 @@ fn min_aa28ad() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_aa28ad(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl index adffe08059..6338bf2525 100644 --- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_aa28ad() { float2 res = min(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { min_aa28ad(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl index e3235d3cee..7959144a2d 100644 --- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_aa28ad() { float2 res = fmin(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_aa28ad(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm index e37dabc85b..a45fdff5a6 100644 --- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_aa28ad "min_aa28ad" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_aa28ad = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 NMin %12 %12 - OpStore %res %9 + %min_aa28ad = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 NMin %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %min_aa28ad + %26 = OpFunctionCall %void %min_aa28ad + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %min_aa28ad +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %min_aa28ad OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %min_aa28ad +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %min_aa28ad OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl index ea0d321b3a..b545fa6eda 100644 --- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_aa28ad() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_aa28ad(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/af326d.wgsl b/test/intrinsics/gen/min/af326d.wgsl index 421360a452..c9104fd572 100644 --- a/test/intrinsics/gen/min/af326d.wgsl +++ b/test/intrinsics/gen/min/af326d.wgsl @@ -27,8 +27,9 @@ fn min_af326d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_af326d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl index fd8e65a646..5abdab58bc 100644 --- a/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_af326d() { float res = min(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { min_af326d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.msl b/test/intrinsics/gen/min/af326d.wgsl.expected.msl index 9e219a38b9..d0e009b9ed 100644 --- a/test/intrinsics/gen/min/af326d.wgsl.expected.msl +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_af326d() { float res = fmin(1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_af326d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm index a7c01c318e..f56cffeb96 100644 --- a/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_af326d "min_af326d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %min_af326d = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %min_af326d = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 NMin %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 NMin %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %min_af326d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %min_af326d - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %min_af326d + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %min_af326d + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %min_af326d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_af326d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl index 6e1515de20..3af8613faf 100644 --- a/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_af326d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_af326d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/c70bb7.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl index 6daef6c409..0510558e72 100644 --- a/test/intrinsics/gen/min/c70bb7.wgsl +++ b/test/intrinsics/gen/min/c70bb7.wgsl @@ -27,8 +27,9 @@ fn min_c70bb7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_c70bb7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl index 0d4d6a6a55..a7f58af9a5 100644 --- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_c70bb7() { uint3 res = min(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { min_c70bb7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl index d49a6bcea3..09c6b44a5b 100644 --- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_c70bb7() { uint3 res = min(uint3(), uint3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_c70bb7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm index c5b03abc9e..df2e8f1346 100644 --- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_c70bb7 "min_c70bb7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %13 = OpConstantNull %v3uint + %17 = OpConstantNull %v3uint %_ptr_Function_v3uint = OpTypePointer Function %v3uint + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_c70bb7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3uint Function %13 - %9 = OpExtInst %v3uint %12 UMin %13 %13 - OpStore %res %9 + %min_c70bb7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %17 + %13 = OpExtInst %v3uint %16 UMin %17 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_c70bb7 + %27 = OpFunctionCall %void %min_c70bb7 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_c70bb7 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_c70bb7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_c70bb7 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_c70bb7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl index 3d86d952f2..b9679de258 100644 --- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_c70bb7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_c70bb7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/c73147.wgsl b/test/intrinsics/gen/min/c73147.wgsl index 09dd3c44ea..9ebc8fd41e 100644 --- a/test/intrinsics/gen/min/c73147.wgsl +++ b/test/intrinsics/gen/min/c73147.wgsl @@ -27,8 +27,9 @@ fn min_c73147() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_c73147(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl index 3f6819a655..1fddfd9774 100644 --- a/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_c73147() { int res = min(1, 1); } -void vertex_main() { +tint_symbol vertex_main() { min_c73147(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.msl b/test/intrinsics/gen/min/c73147.wgsl.expected.msl index 9ee44eea4c..7ec0d477ba 100644 --- a/test/intrinsics/gen/min/c73147.wgsl.expected.msl +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_c73147() { int res = min(1, 1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_c73147(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm index 687c902425..85c0cb7101 100644 --- a/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm @@ -1,54 +1,70 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 26 +; Bound: 35 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_c73147 "min_c73147" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_int = OpTypePointer Function %int - %15 = OpConstantNull %int + %19 = OpConstantNull %int + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_c73147 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_int Function %15 - %9 = OpExtInst %int %11 SMin %int_1 %int_1 - OpStore %res %9 + %min_c73147 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %13 = OpExtInst %int %15 SMin %int_1 %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float + %23 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel OpStore %tint_pointsize %float_1 - %19 = OpFunctionCall %void %min_c73147 + %27 = OpFunctionCall %void %min_c73147 + %28 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %21 = OpLabel - %22 = OpFunctionCall %void %min_c73147 +%fragment_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_c73147 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %24 = OpLabel - %25 = OpFunctionCall %void %min_c73147 +%compute_main = OpFunction %void None %9 + %33 = OpLabel + %34 = OpFunctionCall %void %min_c73147 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl index 59a2cfc958..6221b97c13 100644 --- a/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_c73147() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_c73147(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/c76fa6.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl index 86b14be5a7..6872263e12 100644 --- a/test/intrinsics/gen/min/c76fa6.wgsl +++ b/test/intrinsics/gen/min/c76fa6.wgsl @@ -27,8 +27,9 @@ fn min_c76fa6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_c76fa6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl index 55d25a7062..72c91f1280 100644 --- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void min_c76fa6() { float4 res = min(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { min_c76fa6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl index 85a723e770..015d645054 100644 --- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void min_c76fa6() { float4 res = fmin(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { min_c76fa6(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm index f8e63d7119..c537c48a58 100644 --- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %min_c76fa6 "min_c76fa6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %min_c76fa6 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 NMin %12 %12 - OpStore %res %9 + %min_c76fa6 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 NMin %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %min_c76fa6 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %min_c76fa6 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %min_c76fa6 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %min_c76fa6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %min_c76fa6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl index b9c81fd9f0..d56585ab32 100644 --- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn min_c76fa6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { min_c76fa6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl index 497f81a164..1e3da74d5d 100644 --- a/test/intrinsics/gen/mix/0c8c33.wgsl +++ b/test/intrinsics/gen/mix/0c8c33.wgsl @@ -27,8 +27,9 @@ fn mix_0c8c33() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_0c8c33(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl index b5206557a6..eae91728d6 100644 --- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void mix_0c8c33() { float3 res = lerp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { mix_0c8c33(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl index a9ba57ea91..6cc23a6b13 100644 --- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void mix_0c8c33() { float3 res = mix(float3(), float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { mix_0c8c33(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm index 7ebdd25311..431e74bd8e 100644 --- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %mix_0c8c33 "mix_0c8c33" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %mix_0c8c33 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 FMix %12 %12 %12 - OpStore %res %9 + %mix_0c8c33 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 FMix %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %mix_0c8c33 + %26 = OpFunctionCall %void %mix_0c8c33 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %mix_0c8c33 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %mix_0c8c33 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %mix_0c8c33 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %mix_0c8c33 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl index cbcde05263..9041badf14 100644 --- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn mix_0c8c33() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_0c8c33(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl index ff54cd21b6..97269b2b56 100644 --- a/test/intrinsics/gen/mix/4f0b5e.wgsl +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl @@ -27,8 +27,9 @@ fn mix_4f0b5e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_4f0b5e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl index 0e0d6cf850..f26b24fead 100644 --- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void mix_4f0b5e() { float res = lerp(1.0f, 1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { mix_4f0b5e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl index 2ed9515099..9e549faa14 100644 --- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void mix_4f0b5e() { float res = mix(1.0f, 1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { mix_4f0b5e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm index a35bde53f3..60937eeaa7 100644 --- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %mix_4f0b5e "mix_4f0b5e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %mix_4f0b5e = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %mix_4f0b5e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 FMix %float_1 %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 FMix %float_1 %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %mix_4f0b5e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %mix_4f0b5e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %mix_4f0b5e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %mix_4f0b5e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %mix_4f0b5e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %mix_4f0b5e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl index 847669d6bd..3b31571734 100644 --- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn mix_4f0b5e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_4f0b5e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl index b38477c862..50f54b7a04 100644 --- a/test/intrinsics/gen/mix/6f8adc.wgsl +++ b/test/intrinsics/gen/mix/6f8adc.wgsl @@ -27,8 +27,9 @@ fn mix_6f8adc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_6f8adc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl index dd8fa59c33..c9d077bc4c 100644 --- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void mix_6f8adc() { float2 res = lerp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { mix_6f8adc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl index 6e65e0361c..34ac943d8e 100644 --- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void mix_6f8adc() { float2 res = mix(float2(), float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { mix_6f8adc(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm index ea47804fcf..7d6f63986d 100644 --- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %mix_6f8adc "mix_6f8adc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %mix_6f8adc = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 FMix %12 %12 %12 - OpStore %res %9 + %mix_6f8adc = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 FMix %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %mix_6f8adc + %26 = OpFunctionCall %void %mix_6f8adc + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %mix_6f8adc +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %mix_6f8adc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %mix_6f8adc +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %mix_6f8adc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl index 7a2ae66162..2ee8dd27f2 100644 --- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn mix_6f8adc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_6f8adc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/c37ede.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl index 083fa4d18e..c8a16a9559 100644 --- a/test/intrinsics/gen/mix/c37ede.wgsl +++ b/test/intrinsics/gen/mix/c37ede.wgsl @@ -27,8 +27,9 @@ fn mix_c37ede() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_c37ede(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl index e66be23ec9..d0bd6799ed 100644 --- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void mix_c37ede() { float4 res = lerp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { mix_c37ede(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl index 2da352e20f..246ff75297 100644 --- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void mix_c37ede() { float4 res = mix(float4(), float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { mix_c37ede(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm index 4277d148f8..7aa03fccf0 100644 --- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %mix_c37ede "mix_c37ede" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %mix_c37ede = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 FMix %12 %12 %12 - OpStore %res %9 + %mix_c37ede = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 FMix %8 %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %mix_c37ede - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %mix_c37ede + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %mix_c37ede + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %mix_c37ede + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %mix_c37ede OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl index 72a921b995..2c82feed8e 100644 --- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn mix_c37ede() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { mix_c37ede(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/8d6261.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl index fbc453deda..ac17fa60bc 100644 --- a/test/intrinsics/gen/modf/8d6261.wgsl +++ b/test/intrinsics/gen/modf/8d6261.wgsl @@ -28,8 +28,9 @@ fn modf_8d6261() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_8d6261(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm index ca34c913e3..48358261fc 100644 --- a/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm +++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %12 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %modf_8d6261 "modf_8d6261" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %_ptr_Function_float = OpTypePointer Function %float %float_1 = OpConstant %float 1 -%modf_8d6261 = OpFunction %void None %5 - %8 = OpLabel + %20 = OpTypeFunction %void %v4float +%modf_8d6261 = OpFunction %void None %9 + %12 = OpLabel %arg_1 = OpVariable %_ptr_Function_float Function %4 %res = OpVariable %_ptr_Function_float Function %4 - %11 = OpExtInst %float %12 Modf %float_1 %arg_1 - OpStore %res %11 + %15 = OpExtInst %float %16 Modf %float_1 %arg_1 + OpStore %res %15 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %17 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %modf_8d6261 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %modf_8d6261 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %modf_8d6261 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %25 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %modf_8d6261 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %modf_8d6261 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %modf_8d6261 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl index 2afc9f9c09..e23dd0cdbe 100644 --- a/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl +++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn modf_8d6261() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_8d6261(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl index c8fa7a7722..bc0651dac4 100644 --- a/test/intrinsics/gen/modf/c82e3f.wgsl +++ b/test/intrinsics/gen/modf/c82e3f.wgsl @@ -28,8 +28,9 @@ fn modf_c82e3f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_c82e3f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm index e32d405be2..962fba011c 100644 --- a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %16 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %modf_c82e3f "modf_c82e3f" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float - %12 = OpConstantNull %v4float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%modf_c82e3f = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v4float Function %12 - %res = OpVariable %_ptr_Function_v4float Function %12 - %13 = OpExtInst %v4float %14 Modf %12 %arg_1 - OpStore %res %13 +%modf_c82e3f = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v4float Function %8 + %res = OpVariable %_ptr_Function_v4float Function %8 + %15 = OpExtInst %v4float %16 Modf %8 %arg_1 + OpStore %res %15 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %modf_c82e3f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %modf_c82e3f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %modf_c82e3f + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %modf_c82e3f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %modf_c82e3f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl index 17caaf064e..60bcecde69 100644 --- a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn modf_c82e3f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_c82e3f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/d62477.wgsl b/test/intrinsics/gen/modf/d62477.wgsl index a96fefe99a..694148e814 100644 --- a/test/intrinsics/gen/modf/d62477.wgsl +++ b/test/intrinsics/gen/modf/d62477.wgsl @@ -28,8 +28,9 @@ fn modf_d62477() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_d62477(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm index 6f536e10b9..cef08e63ff 100644 --- a/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm +++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %18 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %modf_d62477 "modf_d62477" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 %_ptr_Function_v2float = OpTypePointer Function %v2float - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%modf_d62477 = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v2float Function %12 - %res = OpVariable %_ptr_Function_v2float Function %12 - %13 = OpExtInst %v2float %14 Modf %12 %arg_1 - OpStore %res %13 +%modf_d62477 = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v2float Function %16 + %res = OpVariable %_ptr_Function_v2float Function %16 + %17 = OpExtInst %v2float %18 Modf %16 %arg_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %modf_d62477 + %28 = OpFunctionCall %void %modf_d62477 + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %modf_d62477 +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %modf_d62477 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %modf_d62477 +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %modf_d62477 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl index 0dd0dff241..5bd5b420e4 100644 --- a/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl +++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn modf_d62477() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_d62477(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl index 2127285c4c..4b7d03bdd9 100644 --- a/test/intrinsics/gen/modf/f9f98c.wgsl +++ b/test/intrinsics/gen/modf/f9f98c.wgsl @@ -28,8 +28,9 @@ fn modf_f9f98c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_f9f98c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm index 44dfbf85f8..b62c50afdd 100644 --- a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %14 = OpExtInstImport "GLSL.std.450" + %18 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %modf_f9f98c "modf_f9f98c" OpName %arg_1 "arg_1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 %_ptr_Function_v3float = OpTypePointer Function %v3float - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%modf_f9f98c = OpFunction %void None %5 - %8 = OpLabel - %arg_1 = OpVariable %_ptr_Function_v3float Function %12 - %res = OpVariable %_ptr_Function_v3float Function %12 - %13 = OpExtInst %v3float %14 Modf %12 %arg_1 - OpStore %res %13 +%modf_f9f98c = OpFunction %void None %9 + %12 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v3float Function %16 + %res = OpVariable %_ptr_Function_v3float Function %16 + %17 = OpExtInst %v3float %18 Modf %16 %arg_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %modf_f9f98c + %28 = OpFunctionCall %void %modf_f9f98c + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %modf_f9f98c +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %modf_f9f98c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %modf_f9f98c +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %modf_f9f98c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl index 31d6412fb2..432b127a90 100644 --- a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl @@ -4,8 +4,9 @@ fn modf_f9f98c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { modf_f9f98c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl index 5cc727436e..56ebb03120 100644 --- a/test/intrinsics/gen/normalize/64d8c0.wgsl +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl @@ -27,8 +27,9 @@ fn normalize_64d8c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { normalize_64d8c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl index c3c93d9676..a07882924e 100644 --- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void normalize_64d8c0() { float3 res = normalize(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { normalize_64d8c0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl index 63a1895058..39c646284a 100644 --- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void normalize_64d8c0() { float3 res = normalize(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { normalize_64d8c0(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm index c3c10f9b0b..311fe461a5 100644 --- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %normalize_64d8c0 "normalize_64d8c0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%normalize_64d8c0 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Normalize %12 - OpStore %res %9 +%normalize_64d8c0 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Normalize %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %normalize_64d8c0 + %26 = OpFunctionCall %void %normalize_64d8c0 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %normalize_64d8c0 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %normalize_64d8c0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %normalize_64d8c0 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %normalize_64d8c0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl index 39498457ea..cf51163256 100644 --- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn normalize_64d8c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { normalize_64d8c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl index 264049952b..347d43bf5e 100644 --- a/test/intrinsics/gen/normalize/9a0aab.wgsl +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl @@ -27,8 +27,9 @@ fn normalize_9a0aab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { normalize_9a0aab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl index 064c75879a..b03bff5bb9 100644 --- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void normalize_9a0aab() { float4 res = normalize(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { normalize_9a0aab(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl index 84dc468490..2dc22f3929 100644 --- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void normalize_9a0aab() { float4 res = normalize(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { normalize_9a0aab(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm index a261175cfa..9a06b7e383 100644 --- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %normalize_9a0aab "normalize_9a0aab" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%normalize_9a0aab = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Normalize %12 - OpStore %res %9 +%normalize_9a0aab = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Normalize %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %normalize_9a0aab - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %normalize_9a0aab + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %normalize_9a0aab + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %normalize_9a0aab + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %normalize_9a0aab OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl index 979531fdb4..d88f83aaee 100644 --- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn normalize_9a0aab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { normalize_9a0aab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl index 498bd96065..aae33f1766 100644 --- a/test/intrinsics/gen/normalize/fc2ef1.wgsl +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl @@ -27,8 +27,9 @@ fn normalize_fc2ef1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { normalize_fc2ef1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl index aba2121733..03f2379b9a 100644 --- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void normalize_fc2ef1() { float2 res = normalize(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { normalize_fc2ef1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl index 6fb812869f..7e5afe0827 100644 --- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void normalize_fc2ef1() { float2 res = normalize(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { normalize_fc2ef1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm index 99cc6bdb7a..98db250824 100644 --- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %normalize_fc2ef1 "normalize_fc2ef1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%normalize_fc2ef1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Normalize %12 - OpStore %res %9 +%normalize_fc2ef1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Normalize %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %normalize_fc2ef1 + %26 = OpFunctionCall %void %normalize_fc2ef1 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %normalize_fc2ef1 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %normalize_fc2ef1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %normalize_fc2ef1 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %normalize_fc2ef1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl index 8c35391f48..a2919144ba 100644 --- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn normalize_fc2ef1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { normalize_fc2ef1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl index 8765662159..eaa89292ed 100644 --- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl @@ -27,8 +27,9 @@ fn pack2x16float_0e97b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack2x16float_0e97b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl index c942222deb..b641eeab3e 100644 --- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl @@ -1,11 +1,16 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pack2x16float_0e97b3() { uint2 tint_tmp = f32tof16(float2(0.0f, 0.0f)); uint res = (tint_tmp.x | tint_tmp.y << 16); } -void vertex_main() { +tint_symbol vertex_main() { pack2x16float_0e97b3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl index 04b790d455..05f90db03b 100644 --- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pack2x16float_0e97b3() { uint res = as_type(half2(float2())); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pack2x16float_0e97b3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm index c8eac8bea4..4ee8e50b4a 100644 --- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pack2x16float_0e97b3 "pack2x16float_0e97b3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %_ptr_Function_uint = OpTypePointer Function %uint - %16 = OpConstantNull %uint + %20 = OpConstantNull %uint + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%pack2x16float_0e97b3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %16 - %9 = OpExtInst %uint %11 PackHalf2x16 %13 - OpStore %res %9 +%pack2x16float_0e97b3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %20 + %13 = OpExtInst %uint %15 PackHalf2x16 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %pack2x16float_0e97b3 + %28 = OpFunctionCall %void %pack2x16float_0e97b3 + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %pack2x16float_0e97b3 +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %pack2x16float_0e97b3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %pack2x16float_0e97b3 +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %pack2x16float_0e97b3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl index d4d2b137c4..f866c86822 100644 --- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pack2x16float_0e97b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack2x16float_0e97b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl index 1ce08a3f17..692e9bfe3a 100644 --- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl @@ -27,8 +27,9 @@ fn pack2x16snorm_6c169b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack2x16snorm_6c169b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl index f8db4b3eea..9b389656d2 100644 --- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl @@ -1,11 +1,16 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pack2x16snorm_6c169b() { int2 tint_tmp = int2(round(clamp(float2(0.0f, 0.0f), -1.0, 1.0) * 32767.0)) & 0xffff; uint res = asuint(tint_tmp.x | tint_tmp.y << 16); } -void vertex_main() { +tint_symbol vertex_main() { pack2x16snorm_6c169b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl index 744c4b48c2..7e91e3b390 100644 --- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pack2x16snorm_6c169b() { uint res = pack_float_to_snorm2x16(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pack2x16snorm_6c169b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm index 73ea23a11c..b877da4851 100644 --- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pack2x16snorm_6c169b "pack2x16snorm_6c169b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %_ptr_Function_uint = OpTypePointer Function %uint - %16 = OpConstantNull %uint + %20 = OpConstantNull %uint + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%pack2x16snorm_6c169b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %16 - %9 = OpExtInst %uint %11 PackSnorm2x16 %13 - OpStore %res %9 +%pack2x16snorm_6c169b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %20 + %13 = OpExtInst %uint %15 PackSnorm2x16 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %pack2x16snorm_6c169b + %28 = OpFunctionCall %void %pack2x16snorm_6c169b + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %pack2x16snorm_6c169b +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %pack2x16snorm_6c169b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %pack2x16snorm_6c169b +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %pack2x16snorm_6c169b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl index 33b7961e25..e693486673 100644 --- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pack2x16snorm_6c169b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack2x16snorm_6c169b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl index 7e28d98b6a..3afaeed7c2 100644 --- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl @@ -27,8 +27,9 @@ fn pack2x16unorm_0f08e4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack2x16unorm_0f08e4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl index 4893f30672..e7d59a9b75 100644 --- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl @@ -1,11 +1,16 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pack2x16unorm_0f08e4() { uint2 tint_tmp = uint2(round(clamp(float2(0.0f, 0.0f), 0.0, 1.0) * 65535.0)); uint res = (tint_tmp.x | tint_tmp.y << 16); } -void vertex_main() { +tint_symbol vertex_main() { pack2x16unorm_0f08e4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl index 4032c7aef9..5f507aa756 100644 --- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pack2x16unorm_0f08e4() { uint res = pack_float_to_unorm2x16(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pack2x16unorm_0f08e4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm index bdd07e723c..448a04a7c8 100644 --- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pack2x16unorm_0f08e4 "pack2x16unorm_0f08e4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2float = OpTypeVector %float 2 - %13 = OpConstantNull %v2float + %17 = OpConstantNull %v2float %_ptr_Function_uint = OpTypePointer Function %uint - %16 = OpConstantNull %uint + %20 = OpConstantNull %uint + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%pack2x16unorm_0f08e4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %16 - %9 = OpExtInst %uint %11 PackUnorm2x16 %13 - OpStore %res %9 +%pack2x16unorm_0f08e4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %20 + %13 = OpExtInst %uint %15 PackUnorm2x16 %17 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %pack2x16unorm_0f08e4 + %28 = OpFunctionCall %void %pack2x16unorm_0f08e4 + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %pack2x16unorm_0f08e4 +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %pack2x16unorm_0f08e4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %pack2x16unorm_0f08e4 +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %pack2x16unorm_0f08e4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl index 50a1f43c52..5022289e2e 100644 --- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pack2x16unorm_0f08e4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack2x16unorm_0f08e4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl index 926a674868..10b7803406 100644 --- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl @@ -27,8 +27,9 @@ fn pack4x8snorm_4d22e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack4x8snorm_4d22e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl index fdb571fe29..b2ac524c81 100644 --- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl @@ -1,11 +1,16 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pack4x8snorm_4d22e7() { int4 tint_tmp = int4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), -1.0, 1.0) * 127.0)) & 0xff; uint res = asuint(tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24); } -void vertex_main() { +tint_symbol vertex_main() { pack4x8snorm_4d22e7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl index 29469ceee8..f4311c91a6 100644 --- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pack4x8snorm_4d22e7() { uint res = pack_float_to_snorm4x8(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pack4x8snorm_4d22e7(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm index 14c3fed7b9..2455ddf00f 100644 --- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pack4x8snorm_4d22e7 "pack4x8snorm_4d22e7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void - %uint = OpTypeInt 32 0 %v4float = OpTypeVector %float 4 - %13 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void + %uint = OpTypeInt 32 0 %_ptr_Function_uint = OpTypePointer Function %uint - %16 = OpConstantNull %uint + %18 = OpConstantNull %uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%pack4x8snorm_4d22e7 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %16 - %9 = OpExtInst %uint %11 PackSnorm4x8 %13 - OpStore %res %9 +%pack4x8snorm_4d22e7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %18 + %13 = OpExtInst %uint %15 PackSnorm4x8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %pack4x8snorm_4d22e7 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %pack4x8snorm_4d22e7 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %pack4x8snorm_4d22e7 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %pack4x8snorm_4d22e7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %pack4x8snorm_4d22e7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl index f004930b8a..11c9f643d3 100644 --- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pack4x8snorm_4d22e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack4x8snorm_4d22e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl index 7d2487596e..12bf088cb9 100644 --- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl @@ -27,8 +27,9 @@ fn pack4x8unorm_95c456() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack4x8unorm_95c456(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl index d28797ecf8..1dc64d05c6 100644 --- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl @@ -1,11 +1,16 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pack4x8unorm_95c456() { uint4 tint_tmp = uint4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), 0.0, 1.0) * 255.0)); uint res = (tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24); } -void vertex_main() { +tint_symbol vertex_main() { pack4x8unorm_95c456(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl index 0871406087..6edb56f425 100644 --- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pack4x8unorm_95c456() { uint res = pack_float_to_unorm4x8(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pack4x8unorm_95c456(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm index 2dd4c33e61..88f6962caf 100644 --- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pack4x8unorm_95c456 "pack4x8unorm_95c456" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void - %uint = OpTypeInt 32 0 %v4float = OpTypeVector %float 4 - %13 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void + %uint = OpTypeInt 32 0 %_ptr_Function_uint = OpTypePointer Function %uint - %16 = OpConstantNull %uint + %18 = OpConstantNull %uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%pack4x8unorm_95c456 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %16 - %9 = OpExtInst %uint %11 PackUnorm4x8 %13 - OpStore %res %9 +%pack4x8unorm_95c456 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %18 + %13 = OpExtInst %uint %15 PackUnorm4x8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %pack4x8unorm_95c456 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %pack4x8unorm_95c456 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %pack4x8unorm_95c456 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %pack4x8unorm_95c456 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %pack4x8unorm_95c456 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl index 1b296f9e0b..278de47e79 100644 --- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pack4x8unorm_95c456() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pack4x8unorm_95c456(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/04a908.wgsl b/test/intrinsics/gen/pow/04a908.wgsl index c91e6cfbdd..0ee93c16da 100644 --- a/test/intrinsics/gen/pow/04a908.wgsl +++ b/test/intrinsics/gen/pow/04a908.wgsl @@ -27,8 +27,9 @@ fn pow_04a908() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_04a908(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl index ad542353d8..15e1d54802 100644 --- a/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pow_04a908() { float4 res = pow(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { pow_04a908(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl index 228e56f466..73909be9e6 100644 --- a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pow_04a908() { float4 res = pow(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pow_04a908(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm index ac6771982d..387d9cb797 100644 --- a/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pow_04a908 "pow_04a908" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %pow_04a908 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Pow %12 %12 - OpStore %res %9 + %pow_04a908 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Pow %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %pow_04a908 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %pow_04a908 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %pow_04a908 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %pow_04a908 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %pow_04a908 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl index cbbf4b798d..22ebe8ab7b 100644 --- a/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pow_04a908() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_04a908(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/46e029.wgsl b/test/intrinsics/gen/pow/46e029.wgsl index b373967673..a9c96f1b81 100644 --- a/test/intrinsics/gen/pow/46e029.wgsl +++ b/test/intrinsics/gen/pow/46e029.wgsl @@ -27,8 +27,9 @@ fn pow_46e029() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_46e029(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl index 193aaeaaec..94d33432ce 100644 --- a/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pow_46e029() { float res = pow(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { pow_46e029(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl index 22cdf1fd96..d1bd4b930b 100644 --- a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pow_46e029() { float res = pow(1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pow_46e029(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm index 030a77e501..8eadbb0eaa 100644 --- a/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pow_46e029 "pow_46e029" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %pow_46e029 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %pow_46e029 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Pow %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Pow %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %pow_46e029 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %pow_46e029 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %pow_46e029 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %pow_46e029 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %pow_46e029 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %pow_46e029 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl index 6aae69e836..0630887aab 100644 --- a/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pow_46e029() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_46e029(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl index cf1801d44e..eedeae00d3 100644 --- a/test/intrinsics/gen/pow/4a46c9.wgsl +++ b/test/intrinsics/gen/pow/4a46c9.wgsl @@ -27,8 +27,9 @@ fn pow_4a46c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_4a46c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl index 4b79a217bf..647b0db851 100644 --- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pow_4a46c9() { float3 res = pow(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { pow_4a46c9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl index e518b163ee..6765ee73bd 100644 --- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pow_4a46c9() { float3 res = pow(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pow_4a46c9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm index 3ba1ee0a9d..d15b172b9f 100644 --- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pow_4a46c9 "pow_4a46c9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %pow_4a46c9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Pow %12 %12 - OpStore %res %9 + %pow_4a46c9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Pow %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %pow_4a46c9 + %26 = OpFunctionCall %void %pow_4a46c9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %pow_4a46c9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %pow_4a46c9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %pow_4a46c9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %pow_4a46c9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl index c789baa72c..b02d7fc264 100644 --- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pow_4a46c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_4a46c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl index ad3bb6cf8f..fb93bfb44a 100644 --- a/test/intrinsics/gen/pow/e60ea5.wgsl +++ b/test/intrinsics/gen/pow/e60ea5.wgsl @@ -27,8 +27,9 @@ fn pow_e60ea5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_e60ea5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl index b03968bf65..c9faab8693 100644 --- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void pow_e60ea5() { float2 res = pow(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { pow_e60ea5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl index d957e7637e..7e1c6f7bd2 100644 --- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void pow_e60ea5() { float2 res = pow(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { pow_e60ea5(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm index 8aeb680b66..27bfedb3d4 100644 --- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %pow_e60ea5 "pow_e60ea5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %pow_e60ea5 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Pow %12 %12 - OpStore %res %9 + %pow_e60ea5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Pow %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %pow_e60ea5 + %26 = OpFunctionCall %void %pow_e60ea5 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %pow_e60ea5 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %pow_e60ea5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %pow_e60ea5 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %pow_e60ea5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl index d8c2cb6a1a..88837a195d 100644 --- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn pow_e60ea5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { pow_e60ea5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/05357e.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl index 79795c5339..662463d546 100644 --- a/test/intrinsics/gen/reflect/05357e.wgsl +++ b/test/intrinsics/gen/reflect/05357e.wgsl @@ -27,8 +27,9 @@ fn reflect_05357e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_05357e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl index 8b788a25a5..fed17cd837 100644 --- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reflect_05357e() { float4 res = reflect(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { reflect_05357e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl index 22542302bb..10fb0cbb70 100644 --- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reflect_05357e() { float4 res = reflect(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reflect_05357e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm index 5326fc6490..e73594a8f4 100644 --- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reflect_05357e "reflect_05357e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reflect_05357e = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Reflect %12 %12 - OpStore %res %9 +%reflect_05357e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Reflect %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reflect_05357e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %reflect_05357e + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %reflect_05357e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %reflect_05357e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %reflect_05357e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl index 579584818e..e02b51bf2d 100644 --- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reflect_05357e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_05357e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl index ce35141f2d..108d1dcb61 100644 --- a/test/intrinsics/gen/reflect/b61e10.wgsl +++ b/test/intrinsics/gen/reflect/b61e10.wgsl @@ -27,8 +27,9 @@ fn reflect_b61e10() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_b61e10(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl index 57643e7203..a80f4066ad 100644 --- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reflect_b61e10() { float2 res = reflect(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { reflect_b61e10(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl index a810e76cce..e8c412a955 100644 --- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reflect_b61e10() { float2 res = reflect(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reflect_b61e10(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm index 9e75c2361e..bb16320b31 100644 --- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reflect_b61e10 "reflect_b61e10" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reflect_b61e10 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Reflect %12 %12 - OpStore %res %9 +%reflect_b61e10 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Reflect %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reflect_b61e10 + %26 = OpFunctionCall %void %reflect_b61e10 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reflect_b61e10 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reflect_b61e10 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reflect_b61e10 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reflect_b61e10 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl index 69cebff0ff..20bcaf24aa 100644 --- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reflect_b61e10() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_b61e10(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl index 81ce08e68c..9709528896 100644 --- a/test/intrinsics/gen/reflect/f47fdb.wgsl +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl @@ -27,8 +27,9 @@ fn reflect_f47fdb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_f47fdb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl index f48fec25ea..39eac481d8 100644 --- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reflect_f47fdb() { float3 res = reflect(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { reflect_f47fdb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl index d710cf2632..c0b9c40e1b 100644 --- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reflect_f47fdb() { float3 res = reflect(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reflect_f47fdb(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm index 6b71c48cde..845c7050e2 100644 --- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reflect_f47fdb "reflect_f47fdb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reflect_f47fdb = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Reflect %12 %12 - OpStore %res %9 +%reflect_f47fdb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Reflect %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reflect_f47fdb + %26 = OpFunctionCall %void %reflect_f47fdb + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reflect_f47fdb +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reflect_f47fdb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reflect_f47fdb +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reflect_f47fdb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl index 68fdf25be3..7d2dbb469d 100644 --- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reflect_f47fdb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_f47fdb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/feae90.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl index cd1ef9f50f..c1c4fb7f24 100644 --- a/test/intrinsics/gen/reflect/feae90.wgsl +++ b/test/intrinsics/gen/reflect/feae90.wgsl @@ -27,8 +27,9 @@ fn reflect_feae90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_feae90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl index 9be6d7bc17..1e134b1116 100644 --- a/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reflect_feae90() { float res = reflect(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { reflect_feae90(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm index f8f068078e..3ea067f6a9 100644 --- a/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reflect_feae90 "reflect_feae90" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%reflect_feae90 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%reflect_feae90 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Reflect %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Reflect %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %reflect_feae90 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %reflect_feae90 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %reflect_feae90 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %reflect_feae90 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %reflect_feae90 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %reflect_feae90 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl index 7b3a23bd8e..939a13030a 100644 --- a/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reflect_feae90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reflect_feae90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl index 01dc2895e1..febc2018c0 100644 --- a/test/intrinsics/gen/reverseBits/222177.wgsl +++ b/test/intrinsics/gen/reverseBits/222177.wgsl @@ -27,8 +27,9 @@ fn reverseBits_222177() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_222177(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl index f4c8e996a2..251d14d15c 100644 --- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_222177() { int2 res = reversebits(int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_222177(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl index e4cc0b352b..210f3b392a 100644 --- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_222177() { int2 res = reverse_bits(int2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_222177(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm index f180cb133c..7a72b2c611 100644 --- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_222177 "reverseBits_222177" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %12 = OpConstantNull %v2int + %16 = OpConstantNull %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_222177 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %12 - %9 = OpBitReverse %v2int %12 - OpStore %res %9 +%reverseBits_222177 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %16 + %13 = OpBitReverse %v2int %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_222177 + %26 = OpFunctionCall %void %reverseBits_222177 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_222177 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_222177 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_222177 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_222177 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl index bf364aa03a..60cbc4066d 100644 --- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_222177() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_222177(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl index 4a85781a7b..f2cdb14aa3 100644 --- a/test/intrinsics/gen/reverseBits/35fea9.wgsl +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl @@ -27,8 +27,9 @@ fn reverseBits_35fea9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_35fea9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl index da3cf17b3d..b826d6aec5 100644 --- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_35fea9() { uint4 res = reversebits(uint4(0u, 0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_35fea9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl index 7aea816b3c..2d0b471cde 100644 --- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_35fea9() { uint4 res = reverse_bits(uint4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_35fea9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm index 114d8da7f4..107b4746a9 100644 --- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_35fea9 "reverseBits_35fea9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v4uint = OpTypeVector %uint 4 - %12 = OpConstantNull %v4uint + %16 = OpConstantNull %v4uint %_ptr_Function_v4uint = OpTypePointer Function %v4uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_35fea9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %12 - %9 = OpBitReverse %v4uint %12 - OpStore %res %9 +%reverseBits_35fea9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %16 + %13 = OpBitReverse %v4uint %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_35fea9 + %26 = OpFunctionCall %void %reverseBits_35fea9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_35fea9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_35fea9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_35fea9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_35fea9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl index 850bc8fa3e..39ecfee2ce 100644 --- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_35fea9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_35fea9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl index ecb88511aa..fd1888f0ed 100644 --- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl @@ -27,8 +27,9 @@ fn reverseBits_4dbd6f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_4dbd6f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl index 3d0d9f8654..708d2a0b15 100644 --- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_4dbd6f() { int4 res = reversebits(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_4dbd6f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl index f73e0c68cd..5dde8a3cee 100644 --- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_4dbd6f() { int4 res = reverse_bits(int4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_4dbd6f(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm index 35d075fa4d..040a433801 100644 --- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_4dbd6f "reverseBits_4dbd6f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v4int = OpTypeVector %int 4 - %12 = OpConstantNull %v4int + %16 = OpConstantNull %v4int %_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_4dbd6f = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %12 - %9 = OpBitReverse %v4int %12 - OpStore %res %9 +%reverseBits_4dbd6f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %16 + %13 = OpBitReverse %v4int %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_4dbd6f + %26 = OpFunctionCall %void %reverseBits_4dbd6f + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_4dbd6f +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_4dbd6f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_4dbd6f +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_4dbd6f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl index 282a3c5d0d..ecd9852cf0 100644 --- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_4dbd6f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_4dbd6f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl index 3528f06c6f..396ed411fe 100644 --- a/test/intrinsics/gen/reverseBits/7c4269.wgsl +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl @@ -27,8 +27,9 @@ fn reverseBits_7c4269() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_7c4269(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl index 871fbfc021..9694820041 100644 --- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_7c4269() { int res = reversebits(1); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_7c4269(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl index 07d35098ae..5621f10245 100644 --- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_7c4269() { int res = reverse_bits(1); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_7c4269(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm index c7b168a44d..9201251d3e 100644 --- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_7c4269 "reverseBits_7c4269" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_int = OpTypePointer Function %int - %14 = OpConstantNull %int + %18 = OpConstantNull %int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_7c4269 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_int Function %14 - %9 = OpBitReverse %int %int_1 - OpStore %res %9 +%reverseBits_7c4269 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %13 = OpBitReverse %int %int_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_7c4269 + %26 = OpFunctionCall %void %reverseBits_7c4269 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_7c4269 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_7c4269 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_7c4269 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_7c4269 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl index 3571b73235..aeaf905cfb 100644 --- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_7c4269() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_7c4269(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl index 960cb70258..20efbd565e 100644 --- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl @@ -27,8 +27,9 @@ fn reverseBits_a6ccd4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_a6ccd4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl index 8a1535464c..78ed8c2f1a 100644 --- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_a6ccd4() { uint3 res = reversebits(uint3(0u, 0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_a6ccd4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl index 73b5497476..0158aed30c 100644 --- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_a6ccd4() { uint3 res = reverse_bits(uint3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_a6ccd4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm index 51617d422a..11dbeb9b2c 100644 --- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_a6ccd4 "reverseBits_a6ccd4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v3uint = OpTypeVector %uint 3 - %12 = OpConstantNull %v3uint + %16 = OpConstantNull %v3uint %_ptr_Function_v3uint = OpTypePointer Function %v3uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_a6ccd4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3uint Function %12 - %9 = OpBitReverse %v3uint %12 - OpStore %res %9 +%reverseBits_a6ccd4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %16 + %13 = OpBitReverse %v3uint %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_a6ccd4 + %26 = OpFunctionCall %void %reverseBits_a6ccd4 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_a6ccd4 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_a6ccd4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_a6ccd4 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_a6ccd4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl index 118301be79..8ca19a36e7 100644 --- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_a6ccd4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_a6ccd4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl index aab692d4a3..6235a861bd 100644 --- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl @@ -27,8 +27,9 @@ fn reverseBits_c21bc1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_c21bc1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl index fcf618a623..e3e9170f4b 100644 --- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_c21bc1() { int3 res = reversebits(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_c21bc1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl index 45aa86ee25..b8623bc02b 100644 --- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_c21bc1() { int3 res = reverse_bits(int3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_c21bc1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm index 1f247214d8..d1e61d6346 100644 --- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_c21bc1 "reverseBits_c21bc1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %12 = OpConstantNull %v3int + %16 = OpConstantNull %v3int %_ptr_Function_v3int = OpTypePointer Function %v3int + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_c21bc1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %12 - %9 = OpBitReverse %v3int %12 - OpStore %res %9 +%reverseBits_c21bc1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %16 + %13 = OpBitReverse %v3int %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_c21bc1 + %26 = OpFunctionCall %void %reverseBits_c21bc1 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_c21bc1 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_c21bc1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_c21bc1 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_c21bc1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl index adb06dabc3..0f3f42bd17 100644 --- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_c21bc1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_c21bc1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl index 238cba0fc8..575fbc7911 100644 --- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl @@ -27,8 +27,9 @@ fn reverseBits_e1f4c1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_e1f4c1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl index faf8a4930e..58a73ee37a 100644 --- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_e1f4c1() { uint2 res = reversebits(uint2(0u, 0u)); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_e1f4c1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl index 7c2a68574c..ba544b784f 100644 --- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_e1f4c1() { uint2 res = reverse_bits(uint2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_e1f4c1(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm index 35a6db00cf..d6b4d8847d 100644 --- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_e1f4c1 "reverseBits_e1f4c1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %v2uint = OpTypeVector %uint 2 - %12 = OpConstantNull %v2uint + %16 = OpConstantNull %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_e1f4c1 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2uint Function %12 - %9 = OpBitReverse %v2uint %12 - OpStore %res %9 +%reverseBits_e1f4c1 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %16 + %13 = OpBitReverse %v2uint %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_e1f4c1 + %26 = OpFunctionCall %void %reverseBits_e1f4c1 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_e1f4c1 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_e1f4c1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_e1f4c1 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_e1f4c1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl index 7676c94b76..eef4adebbd 100644 --- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_e1f4c1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_e1f4c1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl index 6f8855dd20..cf4776aba6 100644 --- a/test/intrinsics/gen/reverseBits/e31adf.wgsl +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl @@ -27,8 +27,9 @@ fn reverseBits_e31adf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_e31adf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl index 245c726bea..5d35bfccd8 100644 --- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void reverseBits_e31adf() { uint res = reversebits(1u); } -void vertex_main() { +tint_symbol vertex_main() { reverseBits_e31adf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl index eb2b65cf02..bc9b4af0f8 100644 --- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void reverseBits_e31adf() { uint res = reverse_bits(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { reverseBits_e31adf(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm index d9e3f25670..d40e31b2f3 100644 --- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %reverseBits_e31adf "reverseBits_e31adf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_uint = OpTypePointer Function %uint - %14 = OpConstantNull %uint + %18 = OpConstantNull %uint + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%reverseBits_e31adf = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_uint Function %14 - %9 = OpBitReverse %uint %uint_1 - OpStore %res %9 +%reverseBits_e31adf = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %18 + %13 = OpBitReverse %uint %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %reverseBits_e31adf + %26 = OpFunctionCall %void %reverseBits_e31adf + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %reverseBits_e31adf +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %reverseBits_e31adf OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %reverseBits_e31adf +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %reverseBits_e31adf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl index c3a3a4829a..8c4a086c62 100644 --- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn reverseBits_e31adf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { reverseBits_e31adf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/106c0b.wgsl b/test/intrinsics/gen/round/106c0b.wgsl index d8b36ba729..cbaee80b66 100644 --- a/test/intrinsics/gen/round/106c0b.wgsl +++ b/test/intrinsics/gen/round/106c0b.wgsl @@ -27,8 +27,9 @@ fn round_106c0b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_106c0b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl index 1d5a479d24..c75d2caa7f 100644 --- a/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void round_106c0b() { float4 res = round(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { round_106c0b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl index 460fcfa923..2ae782a9c5 100644 --- a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void round_106c0b() { float4 res = rint(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { round_106c0b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm index 1a456628ca..2227569272 100644 --- a/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %round_106c0b "round_106c0b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%round_106c0b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 RoundEven %12 - OpStore %res %9 +%round_106c0b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 RoundEven %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %round_106c0b - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %round_106c0b + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %round_106c0b + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %round_106c0b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %round_106c0b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl index 454fbb125f..e505c11956 100644 --- a/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn round_106c0b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_106c0b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/1c7897.wgsl b/test/intrinsics/gen/round/1c7897.wgsl index 48f1a1f955..8ff54e05f6 100644 --- a/test/intrinsics/gen/round/1c7897.wgsl +++ b/test/intrinsics/gen/round/1c7897.wgsl @@ -27,8 +27,9 @@ fn round_1c7897() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_1c7897(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl index ca4d1b895a..4c4bb18903 100644 --- a/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void round_1c7897() { float3 res = round(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { round_1c7897(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl index 567828b2d8..608a2febfa 100644 --- a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void round_1c7897() { float3 res = rint(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { round_1c7897(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm index 81b17815ed..6228f41acc 100644 --- a/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %round_1c7897 "round_1c7897" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%round_1c7897 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 RoundEven %12 - OpStore %res %9 +%round_1c7897 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 RoundEven %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %round_1c7897 + %26 = OpFunctionCall %void %round_1c7897 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %round_1c7897 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %round_1c7897 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %round_1c7897 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %round_1c7897 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl index ab42e01365..3691eda773 100644 --- a/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn round_1c7897() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_1c7897(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/52c84d.wgsl b/test/intrinsics/gen/round/52c84d.wgsl index 189a1d5721..2b6e3732e2 100644 --- a/test/intrinsics/gen/round/52c84d.wgsl +++ b/test/intrinsics/gen/round/52c84d.wgsl @@ -27,8 +27,9 @@ fn round_52c84d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_52c84d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl index 948707e5ef..6aa14eb4c0 100644 --- a/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void round_52c84d() { float2 res = round(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { round_52c84d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl index 8b8b6d68c1..b9fc56f903 100644 --- a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void round_52c84d() { float2 res = rint(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { round_52c84d(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm index d3a9a9a93c..e8ef366562 100644 --- a/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %round_52c84d "round_52c84d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%round_52c84d = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 RoundEven %12 - OpStore %res %9 +%round_52c84d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 RoundEven %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %round_52c84d + %26 = OpFunctionCall %void %round_52c84d + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %round_52c84d +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %round_52c84d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %round_52c84d +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %round_52c84d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl index 9243a33965..89febac5a6 100644 --- a/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn round_52c84d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_52c84d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/9edc38.wgsl b/test/intrinsics/gen/round/9edc38.wgsl index 549a6b7951..1d6d64d0b2 100644 --- a/test/intrinsics/gen/round/9edc38.wgsl +++ b/test/intrinsics/gen/round/9edc38.wgsl @@ -27,8 +27,9 @@ fn round_9edc38() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_9edc38(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl index 1cebde8c3b..874ac81673 100644 --- a/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void round_9edc38() { float res = round(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { round_9edc38(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl index bf4f2abd44..0361b2294d 100644 --- a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void round_9edc38() { float res = rint(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { round_9edc38(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm index 8d349145f6..977d0acb4f 100644 --- a/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %round_9edc38 "round_9edc38" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%round_9edc38 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%round_9edc38 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 RoundEven %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 RoundEven %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %round_9edc38 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %round_9edc38 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %round_9edc38 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %round_9edc38 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %round_9edc38 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %round_9edc38 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl index fcb59dcb2a..993bb505ed 100644 --- a/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn round_9edc38() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { round_9edc38(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/00b848.wgsl b/test/intrinsics/gen/select/00b848.wgsl index 61e3913ccd..c88c350e15 100644 --- a/test/intrinsics/gen/select/00b848.wgsl +++ b/test/intrinsics/gen/select/00b848.wgsl @@ -27,8 +27,9 @@ fn select_00b848() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_00b848(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.msl b/test/intrinsics/gen/select/00b848.wgsl.expected.msl index 426deef40f..2b431a8aaa 100644 --- a/test/intrinsics/gen/select/00b848.wgsl.expected.msl +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_00b848() { int2 res = select(int2(), int2(), bool2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_00b848(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl index afae377b0f..90876efc49 100644 --- a/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_00b848() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_00b848(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/01e2cd.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl index 79c24e4020..d3811f2b0e 100644 --- a/test/intrinsics/gen/select/01e2cd.wgsl +++ b/test/intrinsics/gen/select/01e2cd.wgsl @@ -27,8 +27,9 @@ fn select_01e2cd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_01e2cd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl index 652bb8be3d..9f29574b79 100644 --- a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_01e2cd() { int3 res = select(int3(), int3(), bool3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_01e2cd(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl index 8cc641b026..a69ac5ecf1 100644 --- a/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_01e2cd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_01e2cd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/1e960b.wgsl b/test/intrinsics/gen/select/1e960b.wgsl index 94fc946d41..71309eba2e 100644 --- a/test/intrinsics/gen/select/1e960b.wgsl +++ b/test/intrinsics/gen/select/1e960b.wgsl @@ -27,8 +27,9 @@ fn select_1e960b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_1e960b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl index 7b9cc564e7..172ac62b47 100644 --- a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_1e960b() { uint2 res = select(uint2(), uint2(), bool2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_1e960b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl index bbf9f1cece..bb6cbb3211 100644 --- a/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_1e960b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_1e960b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/266aff.wgsl b/test/intrinsics/gen/select/266aff.wgsl index 6ad4aebe1c..88c7d506dd 100644 --- a/test/intrinsics/gen/select/266aff.wgsl +++ b/test/intrinsics/gen/select/266aff.wgsl @@ -27,8 +27,9 @@ fn select_266aff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_266aff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.msl b/test/intrinsics/gen/select/266aff.wgsl.expected.msl index 9e2b612aef..347ac2799a 100644 --- a/test/intrinsics/gen/select/266aff.wgsl.expected.msl +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_266aff() { float2 res = select(float2(), float2(), bool2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_266aff(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl index 2b269b7d7e..9c5385111c 100644 --- a/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_266aff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_266aff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/28a27e.wgsl b/test/intrinsics/gen/select/28a27e.wgsl index 1eb6bba01a..68520c1f26 100644 --- a/test/intrinsics/gen/select/28a27e.wgsl +++ b/test/intrinsics/gen/select/28a27e.wgsl @@ -27,8 +27,9 @@ fn select_28a27e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_28a27e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl index 2e6f617c4b..667c9a1b34 100644 --- a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_28a27e() { uint3 res = select(uint3(), uint3(), bool3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_28a27e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl index fc8858f81e..037afbc0b5 100644 --- a/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_28a27e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_28a27e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/416e14.wgsl b/test/intrinsics/gen/select/416e14.wgsl index 0dd6b76ca9..44f2070a91 100644 --- a/test/intrinsics/gen/select/416e14.wgsl +++ b/test/intrinsics/gen/select/416e14.wgsl @@ -27,8 +27,9 @@ fn select_416e14() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_416e14(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.msl b/test/intrinsics/gen/select/416e14.wgsl.expected.msl index 376f282e36..85cd25a094 100644 --- a/test/intrinsics/gen/select/416e14.wgsl.expected.msl +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_416e14() { float res = select(1.0f, 1.0f, bool()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_416e14(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl index d44749cd89..90abb36c2c 100644 --- a/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_416e14() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_416e14(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/80a9a9.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl index 089c979d2a..6aafb93830 100644 --- a/test/intrinsics/gen/select/80a9a9.wgsl +++ b/test/intrinsics/gen/select/80a9a9.wgsl @@ -27,8 +27,9 @@ fn select_80a9a9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_80a9a9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl index 0263844ad7..3aff43ff29 100644 --- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_80a9a9() { bool3 res = select(bool3(), bool3(), bool3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_80a9a9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm index 34b464e8ea..71bf522f32 100644 --- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %select_80a9a9 "select_80a9a9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v3bool = OpTypeVector %bool 3 - %12 = OpConstantNull %v3bool + %16 = OpConstantNull %v3bool %_ptr_Function_v3bool = OpTypePointer Function %v3bool + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%select_80a9a9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3bool Function %12 - %9 = OpSelect %v3bool %12 %12 %12 - OpStore %res %9 +%select_80a9a9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %16 + %13 = OpSelect %v3bool %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %select_80a9a9 + %26 = OpFunctionCall %void %select_80a9a9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %select_80a9a9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %select_80a9a9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %select_80a9a9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %select_80a9a9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl index 52d6efe9cc..a5fb47d523 100644 --- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_80a9a9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_80a9a9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/99f883.wgsl b/test/intrinsics/gen/select/99f883.wgsl index 7c078a0857..a03ed538d7 100644 --- a/test/intrinsics/gen/select/99f883.wgsl +++ b/test/intrinsics/gen/select/99f883.wgsl @@ -27,8 +27,9 @@ fn select_99f883() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_99f883(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.msl b/test/intrinsics/gen/select/99f883.wgsl.expected.msl index 8332072f32..45e38cfacc 100644 --- a/test/intrinsics/gen/select/99f883.wgsl.expected.msl +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_99f883() { uint res = select(1u, 1u, bool()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_99f883(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl index 6dd41c7799..7ede94b4bb 100644 --- a/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_99f883() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_99f883(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/a2860e.wgsl b/test/intrinsics/gen/select/a2860e.wgsl index 1df8bf585c..4f9458b71e 100644 --- a/test/intrinsics/gen/select/a2860e.wgsl +++ b/test/intrinsics/gen/select/a2860e.wgsl @@ -27,8 +27,9 @@ fn select_a2860e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_a2860e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl index aacb8cee18..d57b00af2c 100644 --- a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_a2860e() { int4 res = select(int4(), int4(), bool4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_a2860e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl index e7cb1ea80f..3c163ae604 100644 --- a/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_a2860e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_a2860e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/bb8aae.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl index 8806956ff9..cc508ba18c 100644 --- a/test/intrinsics/gen/select/bb8aae.wgsl +++ b/test/intrinsics/gen/select/bb8aae.wgsl @@ -27,8 +27,9 @@ fn select_bb8aae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_bb8aae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl index a2418f5627..0ac6179c82 100644 --- a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_bb8aae() { float4 res = select(float4(), float4(), bool4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_bb8aae(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl index 85e05cfc50..019fd04350 100644 --- a/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_bb8aae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_bb8aae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/c31f9e.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl index d7218031bb..dccafd5720 100644 --- a/test/intrinsics/gen/select/c31f9e.wgsl +++ b/test/intrinsics/gen/select/c31f9e.wgsl @@ -27,8 +27,9 @@ fn select_c31f9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_c31f9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl index 6719974b37..21695bd673 100644 --- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_c31f9e() { bool res = select(bool(), bool(), bool()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_c31f9e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm index c0961e98fb..b056d086cd 100644 --- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm @@ -1,52 +1,68 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 24 +; Bound: 33 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %select_c31f9e "select_c31f9e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool - %11 = OpConstantNull %bool + %15 = OpConstantNull %bool %_ptr_Function_bool = OpTypePointer Function %bool + %18 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%select_c31f9e = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_bool Function %11 - %9 = OpSelect %bool %11 %11 %11 - OpStore %res %9 +%select_c31f9e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %13 = OpSelect %bool %15 %15 %15 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float + %21 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel OpStore %tint_pointsize %float_1 - %17 = OpFunctionCall %void %select_c31f9e + %25 = OpFunctionCall %void %select_c31f9e + %26 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %19 = OpLabel - %20 = OpFunctionCall %void %select_c31f9e +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %select_c31f9e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %select_c31f9e +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %select_c31f9e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl index 7ffd827dc8..6b93e425cd 100644 --- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_c31f9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_c31f9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl index 254b37b267..3c2a08b347 100644 --- a/test/intrinsics/gen/select/c4a4ef.wgsl +++ b/test/intrinsics/gen/select/c4a4ef.wgsl @@ -27,8 +27,9 @@ fn select_c4a4ef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_c4a4ef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl index 65a42ac5c4..eb6e007c58 100644 --- a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_c4a4ef() { uint4 res = select(uint4(), uint4(), bool4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_c4a4ef(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl index 4338ad6bf3..68d6006e34 100644 --- a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_c4a4ef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_c4a4ef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/cb9301.wgsl b/test/intrinsics/gen/select/cb9301.wgsl index 968cf2c9fc..ab78579813 100644 --- a/test/intrinsics/gen/select/cb9301.wgsl +++ b/test/intrinsics/gen/select/cb9301.wgsl @@ -27,8 +27,9 @@ fn select_cb9301() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_cb9301(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl index ffdbe51c23..846a79f5c0 100644 --- a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_cb9301() { bool2 res = select(bool2(), bool2(), bool2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_cb9301(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm index cd00a77f37..ab807b3bd3 100644 --- a/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %select_cb9301 "select_cb9301" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v2bool = OpTypeVector %bool 2 - %12 = OpConstantNull %v2bool + %16 = OpConstantNull %v2bool %_ptr_Function_v2bool = OpTypePointer Function %v2bool + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%select_cb9301 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2bool Function %12 - %9 = OpSelect %v2bool %12 %12 %12 - OpStore %res %9 +%select_cb9301 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %16 + %13 = OpSelect %v2bool %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %select_cb9301 + %26 = OpFunctionCall %void %select_cb9301 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %select_cb9301 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %select_cb9301 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %select_cb9301 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %select_cb9301 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl index 5d7c05e8bc..20cc0fa2aa 100644 --- a/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_cb9301() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_cb9301(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/e3e028.wgsl b/test/intrinsics/gen/select/e3e028.wgsl index 9b613b0e48..5bec050126 100644 --- a/test/intrinsics/gen/select/e3e028.wgsl +++ b/test/intrinsics/gen/select/e3e028.wgsl @@ -27,8 +27,9 @@ fn select_e3e028() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_e3e028(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl index 67d331c05b..a1f57f6db2 100644 --- a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_e3e028() { bool4 res = select(bool4(), bool4(), bool4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_e3e028(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm index 9a327a15f4..27ca8f90cd 100644 --- a/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %select_e3e028 "select_e3e028" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %bool = OpTypeBool %v4bool = OpTypeVector %bool 4 - %12 = OpConstantNull %v4bool + %16 = OpConstantNull %v4bool %_ptr_Function_v4bool = OpTypePointer Function %v4bool + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%select_e3e028 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4bool Function %12 - %9 = OpSelect %v4bool %12 %12 %12 - OpStore %res %9 +%select_e3e028 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %16 + %13 = OpSelect %v4bool %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %select_e3e028 + %26 = OpFunctionCall %void %select_e3e028 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %select_e3e028 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %select_e3e028 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %select_e3e028 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %select_e3e028 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl index edf186d655..e059b31483 100644 --- a/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_e3e028() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_e3e028(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/ebfea2.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl index 994a42796d..2e2d1cd851 100644 --- a/test/intrinsics/gen/select/ebfea2.wgsl +++ b/test/intrinsics/gen/select/ebfea2.wgsl @@ -27,8 +27,9 @@ fn select_ebfea2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_ebfea2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl index c1a1253437..81db84cc9c 100644 --- a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_ebfea2() { float3 res = select(float3(), float3(), bool3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_ebfea2(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl index 15cda7c341..e710fc84b2 100644 --- a/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_ebfea2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_ebfea2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/ed8a15.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl index 7b83f92e2d..353f6b732a 100644 --- a/test/intrinsics/gen/select/ed8a15.wgsl +++ b/test/intrinsics/gen/select/ed8a15.wgsl @@ -27,8 +27,9 @@ fn select_ed8a15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_ed8a15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl index 18b9b3af99..2c84ce4fb8 100644 --- a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void select_ed8a15() { int res = select(1, 1, bool()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { select_ed8a15(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl index a569ef0a5e..47a6c61f9d 100644 --- a/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn select_ed8a15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { select_ed8a15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/159665.wgsl b/test/intrinsics/gen/sign/159665.wgsl index 49eb85bf12..068f4e3977 100644 --- a/test/intrinsics/gen/sign/159665.wgsl +++ b/test/intrinsics/gen/sign/159665.wgsl @@ -27,8 +27,9 @@ fn sign_159665() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_159665(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl index 822f73c9fa..99d593a64e 100644 --- a/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sign_159665() { float3 res = sign(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sign_159665(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.msl b/test/intrinsics/gen/sign/159665.wgsl.expected.msl index 143c0281bf..9a0fcb01a3 100644 --- a/test/intrinsics/gen/sign/159665.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sign_159665() { float3 res = sign(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sign_159665(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm index a14e870e5d..b202170d66 100644 --- a/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sign_159665 "sign_159665" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sign_159665 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 FSign %12 - OpStore %res %9 +%sign_159665 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 FSign %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sign_159665 + %26 = OpFunctionCall %void %sign_159665 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sign_159665 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sign_159665 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sign_159665 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sign_159665 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl index 2f7b9a9f3a..a162049b43 100644 --- a/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sign_159665() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_159665(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/b8f634.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl index 85ed595033..5b90dfdcab 100644 --- a/test/intrinsics/gen/sign/b8f634.wgsl +++ b/test/intrinsics/gen/sign/b8f634.wgsl @@ -27,8 +27,9 @@ fn sign_b8f634() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_b8f634(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl index d8c042889d..6c50bbe77e 100644 --- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sign_b8f634() { float4 res = sign(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sign_b8f634(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl index d26088ddd3..b13803aea9 100644 --- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sign_b8f634() { float4 res = sign(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sign_b8f634(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm index 2a2d428e02..dc20942853 100644 --- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sign_b8f634 "sign_b8f634" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sign_b8f634 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 FSign %12 - OpStore %res %9 +%sign_b8f634 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 FSign %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sign_b8f634 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %sign_b8f634 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %sign_b8f634 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sign_b8f634 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sign_b8f634 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl index 4e8e484ee5..8b33b2388e 100644 --- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sign_b8f634() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_b8f634(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/d065d8.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl index 75254a8e01..3ce533fb05 100644 --- a/test/intrinsics/gen/sign/d065d8.wgsl +++ b/test/intrinsics/gen/sign/d065d8.wgsl @@ -27,8 +27,9 @@ fn sign_d065d8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_d065d8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl index 491b380f8b..573489326e 100644 --- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sign_d065d8() { float2 res = sign(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sign_d065d8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl index abacffbb12..dc48e611fa 100644 --- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sign_d065d8() { float2 res = sign(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sign_d065d8(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm index f532736669..224618cbd2 100644 --- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sign_d065d8 "sign_d065d8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sign_d065d8 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 FSign %12 - OpStore %res %9 +%sign_d065d8 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 FSign %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sign_d065d8 + %26 = OpFunctionCall %void %sign_d065d8 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sign_d065d8 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sign_d065d8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sign_d065d8 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sign_d065d8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl index 9079c7fae8..40b0c8d332 100644 --- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sign_d065d8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_d065d8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/dd790e.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl index 762bdfe406..52f58d0247 100644 --- a/test/intrinsics/gen/sign/dd790e.wgsl +++ b/test/intrinsics/gen/sign/dd790e.wgsl @@ -27,8 +27,9 @@ fn sign_dd790e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_dd790e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl index 52f319c990..693c167872 100644 --- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sign_dd790e() { float res = sign(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { sign_dd790e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl index a4d2552b4c..b77013acbc 100644 --- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sign_dd790e() { float res = sign(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sign_dd790e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm index 5403ccb9db..bb97f04fdd 100644 --- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sign_dd790e "sign_dd790e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%sign_dd790e = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%sign_dd790e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 FSign %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 FSign %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %sign_dd790e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %sign_dd790e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %sign_dd790e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %sign_dd790e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sign_dd790e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sign_dd790e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl index 4ec9d2351d..c3f369c9f4 100644 --- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sign_dd790e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sign_dd790e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/01f241.wgsl b/test/intrinsics/gen/sin/01f241.wgsl index b53e8b8601..f739a2ced0 100644 --- a/test/intrinsics/gen/sin/01f241.wgsl +++ b/test/intrinsics/gen/sin/01f241.wgsl @@ -27,8 +27,9 @@ fn sin_01f241() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_01f241(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl index 05afedd069..57f4db0839 100644 --- a/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sin_01f241() { float3 res = sin(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sin_01f241(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl index 22ef88683a..72d06c0477 100644 --- a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sin_01f241() { float3 res = sin(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sin_01f241(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm index e03940b1a0..e459aeaab6 100644 --- a/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sin_01f241 "sin_01f241" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %sin_01f241 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Sin %12 - OpStore %res %9 + %sin_01f241 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Sin %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sin_01f241 + %26 = OpFunctionCall %void %sin_01f241 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sin_01f241 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sin_01f241 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sin_01f241 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sin_01f241 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl index 4717bb5f4a..a1272142e6 100644 --- a/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sin_01f241() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_01f241(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/4e3979.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl index c0282bc1eb..8a09738e1d 100644 --- a/test/intrinsics/gen/sin/4e3979.wgsl +++ b/test/intrinsics/gen/sin/4e3979.wgsl @@ -27,8 +27,9 @@ fn sin_4e3979() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_4e3979(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl index 6ef2c93ec7..a39a10f0bf 100644 --- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sin_4e3979() { float4 res = sin(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sin_4e3979(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl index 331a368a67..8490349a9d 100644 --- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sin_4e3979() { float4 res = sin(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sin_4e3979(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm index af59f4a524..6c33ea5654 100644 --- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sin_4e3979 "sin_4e3979" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %sin_4e3979 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Sin %12 - OpStore %res %9 + %sin_4e3979 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Sin %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sin_4e3979 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %sin_4e3979 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %sin_4e3979 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sin_4e3979 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sin_4e3979 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl index ae9d1451a4..3c787811da 100644 --- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sin_4e3979() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_4e3979(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/b78c91.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl index 35cd7d9df8..99d472fad2 100644 --- a/test/intrinsics/gen/sin/b78c91.wgsl +++ b/test/intrinsics/gen/sin/b78c91.wgsl @@ -27,8 +27,9 @@ fn sin_b78c91() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_b78c91(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl index e3c066a1cc..8714c25a02 100644 --- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sin_b78c91() { float res = sin(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { sin_b78c91(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl index ddada4c38e..b3564835dd 100644 --- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sin_b78c91() { float res = sin(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sin_b78c91(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm index b1ba48dc71..45895ad0bd 100644 --- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sin_b78c91 "sin_b78c91" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %sin_b78c91 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %sin_b78c91 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Sin %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Sin %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %sin_b78c91 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %sin_b78c91 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %sin_b78c91 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %sin_b78c91 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sin_b78c91 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sin_b78c91 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl index de3a1f3546..4b444a42ec 100644 --- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sin_b78c91() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_b78c91(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl index ea5e900cdf..b4314b776a 100644 --- a/test/intrinsics/gen/sin/fc8bc4.wgsl +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl @@ -27,8 +27,9 @@ fn sin_fc8bc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_fc8bc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl index e24e20e027..9b910da838 100644 --- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sin_fc8bc4() { float2 res = sin(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sin_fc8bc4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl index 0dbeea856d..e66435a28e 100644 --- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sin_fc8bc4() { float2 res = sin(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sin_fc8bc4(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm index d9a58ad8f7..18973055e1 100644 --- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sin_fc8bc4 "sin_fc8bc4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %sin_fc8bc4 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Sin %12 - OpStore %res %9 + %sin_fc8bc4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Sin %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sin_fc8bc4 + %26 = OpFunctionCall %void %sin_fc8bc4 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sin_fc8bc4 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sin_fc8bc4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sin_fc8bc4 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sin_fc8bc4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl index 35ad28e84e..26fd4da046 100644 --- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sin_fc8bc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sin_fc8bc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/445e33.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl index 0a62c8184d..15ad5f7b2d 100644 --- a/test/intrinsics/gen/sinh/445e33.wgsl +++ b/test/intrinsics/gen/sinh/445e33.wgsl @@ -27,8 +27,9 @@ fn sinh_445e33() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_445e33(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl index b8cb85b7e4..f2749189dc 100644 --- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sinh_445e33() { float4 res = sinh(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sinh_445e33(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl index 0f8947154d..aa9548284c 100644 --- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sinh_445e33() { float4 res = sinh(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sinh_445e33(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm index 734a54bdbf..71e5771038 100644 --- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sinh_445e33 "sinh_445e33" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sinh_445e33 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Sinh %12 - OpStore %res %9 +%sinh_445e33 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Sinh %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sinh_445e33 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %sinh_445e33 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %sinh_445e33 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sinh_445e33 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sinh_445e33 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl index ad790a5b28..8c279d0bf7 100644 --- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sinh_445e33() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_445e33(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl index b38208c46e..4f810d6ef1 100644 --- a/test/intrinsics/gen/sinh/7bb598.wgsl +++ b/test/intrinsics/gen/sinh/7bb598.wgsl @@ -27,8 +27,9 @@ fn sinh_7bb598() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_7bb598(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl index 181c064146..3edf894a83 100644 --- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sinh_7bb598() { float res = sinh(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { sinh_7bb598(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl index d14c1fbc6f..e6c5990863 100644 --- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sinh_7bb598() { float res = sinh(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sinh_7bb598(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm index 481720dd99..997d3ffac4 100644 --- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sinh_7bb598 "sinh_7bb598" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%sinh_7bb598 = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%sinh_7bb598 = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Sinh %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Sinh %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %sinh_7bb598 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %sinh_7bb598 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %sinh_7bb598 + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %sinh_7bb598 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sinh_7bb598 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sinh_7bb598 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl index ae2a45f406..28ff0c4545 100644 --- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sinh_7bb598() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_7bb598(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl index 5f596f2431..217163ec02 100644 --- a/test/intrinsics/gen/sinh/b9860e.wgsl +++ b/test/intrinsics/gen/sinh/b9860e.wgsl @@ -27,8 +27,9 @@ fn sinh_b9860e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_b9860e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl index 4c2cd68e6c..1a6c8b6f82 100644 --- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sinh_b9860e() { float2 res = sinh(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sinh_b9860e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl index 3f6dc50b8b..5bc5bc4c1c 100644 --- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sinh_b9860e() { float2 res = sinh(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sinh_b9860e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm index 82b4486a1e..bba9adbed0 100644 --- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sinh_b9860e "sinh_b9860e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sinh_b9860e = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Sinh %12 - OpStore %res %9 +%sinh_b9860e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Sinh %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sinh_b9860e + %26 = OpFunctionCall %void %sinh_b9860e + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sinh_b9860e +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sinh_b9860e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sinh_b9860e +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sinh_b9860e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl index 20bc6e3f8f..5e58b9efa6 100644 --- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sinh_b9860e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_b9860e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl index 0f60e63b32..af91887664 100644 --- a/test/intrinsics/gen/sinh/c9a5eb.wgsl +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl @@ -27,8 +27,9 @@ fn sinh_c9a5eb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_c9a5eb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl index b18f22ecd4..044618332a 100644 --- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sinh_c9a5eb() { float3 res = sinh(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sinh_c9a5eb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl index 91ba6f6657..05558c73ad 100644 --- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sinh_c9a5eb() { float3 res = sinh(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sinh_c9a5eb(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm index 480ba1c16e..f923d9f54c 100644 --- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sinh_c9a5eb "sinh_c9a5eb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sinh_c9a5eb = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Sinh %12 - OpStore %res %9 +%sinh_c9a5eb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Sinh %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sinh_c9a5eb + %26 = OpFunctionCall %void %sinh_c9a5eb + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sinh_c9a5eb +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sinh_c9a5eb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sinh_c9a5eb +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sinh_c9a5eb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl index 7056b19854..ce80f1c46f 100644 --- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sinh_c9a5eb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sinh_c9a5eb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl index c71fcf0f69..63da6fd871 100644 --- a/test/intrinsics/gen/smoothStep/5f615b.wgsl +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl @@ -27,8 +27,9 @@ fn smoothStep_5f615b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_5f615b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl index 49c6c6129d..4fe969ca87 100644 --- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void smoothStep_5f615b() { float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { smoothStep_5f615b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl index 3f21ed34b9..22a3ab7944 100644 --- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void smoothStep_5f615b() { float4 res = smoothstep(float4(), float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { smoothStep_5f615b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm index f2e61127c2..f20b7077c7 100644 --- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %smoothStep_5f615b "smoothStep_5f615b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%smoothStep_5f615b = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 SmoothStep %12 %12 %12 - OpStore %res %9 +%smoothStep_5f615b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 SmoothStep %8 %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %smoothStep_5f615b - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %smoothStep_5f615b + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %smoothStep_5f615b + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %smoothStep_5f615b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %smoothStep_5f615b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl index 26e95e4bd9..7e139d1f43 100644 --- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn smoothStep_5f615b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_5f615b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl index c66c45f8db..a068e20fd1 100644 --- a/test/intrinsics/gen/smoothStep/658be3.wgsl +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl @@ -27,8 +27,9 @@ fn smoothStep_658be3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_658be3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl index 80b9c8162f..a33cea44b7 100644 --- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void smoothStep_658be3() { float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { smoothStep_658be3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl index dc7e7a4dd8..42d4a3ac03 100644 --- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void smoothStep_658be3() { float3 res = smoothstep(float3(), float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { smoothStep_658be3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm index 82787971ac..b6a904ee21 100644 --- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %smoothStep_658be3 "smoothStep_658be3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%smoothStep_658be3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 SmoothStep %12 %12 %12 - OpStore %res %9 +%smoothStep_658be3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 SmoothStep %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %smoothStep_658be3 + %26 = OpFunctionCall %void %smoothStep_658be3 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %smoothStep_658be3 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %smoothStep_658be3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %smoothStep_658be3 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %smoothStep_658be3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl index 5a6bd897ef..1b224106fd 100644 --- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn smoothStep_658be3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_658be3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl index 1f531a23fe..b8eab7b3c9 100644 --- a/test/intrinsics/gen/smoothStep/c11eef.wgsl +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl @@ -27,8 +27,9 @@ fn smoothStep_c11eef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_c11eef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl index bda91514ed..a4e9542230 100644 --- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void smoothStep_c11eef() { float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { smoothStep_c11eef(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl index 3f3315dbe1..7788c35041 100644 --- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void smoothStep_c11eef() { float2 res = smoothstep(float2(), float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { smoothStep_c11eef(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm index 4d21a966ca..f393adcb47 100644 --- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %smoothStep_c11eef "smoothStep_c11eef" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%smoothStep_c11eef = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 SmoothStep %12 %12 %12 - OpStore %res %9 +%smoothStep_c11eef = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 SmoothStep %16 %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %smoothStep_c11eef + %26 = OpFunctionCall %void %smoothStep_c11eef + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %smoothStep_c11eef +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %smoothStep_c11eef OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %smoothStep_c11eef +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %smoothStep_c11eef OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl index 147b9fdb45..d2bc420993 100644 --- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn smoothStep_c11eef() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_c11eef(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl index e67b070f19..a1709a6f85 100644 --- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl @@ -27,8 +27,9 @@ fn smoothStep_cb0bfb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_cb0bfb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl index 7f9a93da6c..02c8d1edbe 100644 --- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void smoothStep_cb0bfb() { float res = smoothstep(1.0f, 1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { smoothStep_cb0bfb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl index 9e0b99ad53..f963d98678 100644 --- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void smoothStep_cb0bfb() { float res = smoothstep(1.0f, 1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { smoothStep_cb0bfb(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm index e991a8ce08..a19270acdf 100644 --- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %smoothStep_cb0bfb "smoothStep_cb0bfb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%smoothStep_cb0bfb = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%smoothStep_cb0bfb = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 SmoothStep %float_1 %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 SmoothStep %float_1 %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %smoothStep_cb0bfb - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %smoothStep_cb0bfb - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %smoothStep_cb0bfb + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %smoothStep_cb0bfb + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %smoothStep_cb0bfb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %smoothStep_cb0bfb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl index 7ecfe0cda3..907a327299 100644 --- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn smoothStep_cb0bfb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { smoothStep_cb0bfb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl index 7a74f526bc..6295d0b46a 100644 --- a/test/intrinsics/gen/sqrt/20c74e.wgsl +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl @@ -27,8 +27,9 @@ fn sqrt_20c74e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_20c74e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl index d9fdd428f8..b6b6c4b909 100644 --- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sqrt_20c74e() { float res = sqrt(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { sqrt_20c74e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl index 591cff9fd1..ebe9cc5e61 100644 --- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sqrt_20c74e() { float res = sqrt(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sqrt_20c74e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm index fefbb94e00..7e26f2bdfa 100644 --- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sqrt_20c74e "sqrt_20c74e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%sqrt_20c74e = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%sqrt_20c74e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Sqrt %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Sqrt %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %sqrt_20c74e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %sqrt_20c74e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %sqrt_20c74e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %sqrt_20c74e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sqrt_20c74e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sqrt_20c74e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl index 4aeac6494c..cfb4ca121b 100644 --- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sqrt_20c74e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_20c74e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl index 9286ae37db..d7d700588d 100644 --- a/test/intrinsics/gen/sqrt/8c7024.wgsl +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl @@ -27,8 +27,9 @@ fn sqrt_8c7024() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_8c7024(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl index 2e82392d9e..f6ac0f09a1 100644 --- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sqrt_8c7024() { float2 res = sqrt(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sqrt_8c7024(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl index b2852fffbe..c6e76d03b0 100644 --- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sqrt_8c7024() { float2 res = sqrt(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sqrt_8c7024(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm index ba243fcc71..fd48614c23 100644 --- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sqrt_8c7024 "sqrt_8c7024" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sqrt_8c7024 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Sqrt %12 - OpStore %res %9 +%sqrt_8c7024 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Sqrt %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sqrt_8c7024 + %26 = OpFunctionCall %void %sqrt_8c7024 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sqrt_8c7024 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sqrt_8c7024 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sqrt_8c7024 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sqrt_8c7024 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl index 6b97f1eabd..04e9892a1a 100644 --- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sqrt_8c7024() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_8c7024(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl index d559779cde..a67ebc6191 100644 --- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl @@ -27,8 +27,9 @@ fn sqrt_aa0d7a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_aa0d7a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl index bc2186738f..9ba1434e51 100644 --- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sqrt_aa0d7a() { float4 res = sqrt(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sqrt_aa0d7a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl index 9dbff0ed15..7de1194bf3 100644 --- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sqrt_aa0d7a() { float4 res = sqrt(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sqrt_aa0d7a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm index 0a422cc749..c944fbf97e 100644 --- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sqrt_aa0d7a "sqrt_aa0d7a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sqrt_aa0d7a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Sqrt %12 - OpStore %res %9 +%sqrt_aa0d7a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Sqrt %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sqrt_aa0d7a - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %sqrt_aa0d7a + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %sqrt_aa0d7a + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %sqrt_aa0d7a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %sqrt_aa0d7a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl index 378567474f..ef205f628c 100644 --- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sqrt_aa0d7a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_aa0d7a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl index ab11967e7d..6f0ecd3193 100644 --- a/test/intrinsics/gen/sqrt/f8c59a.wgsl +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl @@ -27,8 +27,9 @@ fn sqrt_f8c59a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_f8c59a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl index 1dd2bc3378..9ccbfea895 100644 --- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void sqrt_f8c59a() { float3 res = sqrt(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { sqrt_f8c59a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl index 9cb74e639b..a0281f7b75 100644 --- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void sqrt_f8c59a() { float3 res = sqrt(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { sqrt_f8c59a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm index c29897ac0e..5d8c11c3ba 100644 --- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %sqrt_f8c59a "sqrt_f8c59a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%sqrt_f8c59a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Sqrt %12 - OpStore %res %9 +%sqrt_f8c59a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Sqrt %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %sqrt_f8c59a + %26 = OpFunctionCall %void %sqrt_f8c59a + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %sqrt_f8c59a +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %sqrt_f8c59a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %sqrt_f8c59a +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %sqrt_f8c59a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl index 3a3adbe243..a0f24c21c9 100644 --- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn sqrt_f8c59a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { sqrt_f8c59a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/0b073b.wgsl b/test/intrinsics/gen/step/0b073b.wgsl index 8efda6061d..059d84da02 100644 --- a/test/intrinsics/gen/step/0b073b.wgsl +++ b/test/intrinsics/gen/step/0b073b.wgsl @@ -27,8 +27,9 @@ fn step_0b073b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_0b073b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl index 4aa8a03b71..3eff0d82ed 100644 --- a/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void step_0b073b() { float res = step(1.0f, 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { step_0b073b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl index 379623df1b..0a76b20d41 100644 --- a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void step_0b073b() { float res = step(1.0f, 1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { step_0b073b(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm index 733e788b3b..43ffb2f019 100644 --- a/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %step_0b073b "step_0b073b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%step_0b073b = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%step_0b073b = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Step %float_1 %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Step %float_1 %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %step_0b073b - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %step_0b073b - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %step_0b073b + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %step_0b073b + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %step_0b073b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %step_0b073b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl index c75b485013..e9ce7e89d8 100644 --- a/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn step_0b073b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_0b073b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/19accd.wgsl b/test/intrinsics/gen/step/19accd.wgsl index faebe4e6b6..ab41384678 100644 --- a/test/intrinsics/gen/step/19accd.wgsl +++ b/test/intrinsics/gen/step/19accd.wgsl @@ -27,8 +27,9 @@ fn step_19accd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_19accd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl index 7dd620568d..c2bd85b030 100644 --- a/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void step_19accd() { float2 res = step(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { step_19accd(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.msl b/test/intrinsics/gen/step/19accd.wgsl.expected.msl index 781b56a1a7..a26cee555b 100644 --- a/test/intrinsics/gen/step/19accd.wgsl.expected.msl +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void step_19accd() { float2 res = step(float2(), float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { step_19accd(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm index 93706b09b9..2ff36a61cd 100644 --- a/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %step_19accd "step_19accd" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%step_19accd = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Step %12 %12 - OpStore %res %9 +%step_19accd = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Step %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %step_19accd + %26 = OpFunctionCall %void %step_19accd + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %step_19accd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %step_19accd OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %step_19accd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %step_19accd OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl index e45f4ee53f..a6c13286f1 100644 --- a/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn step_19accd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_19accd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/334303.wgsl b/test/intrinsics/gen/step/334303.wgsl index e6923573ed..00d7b586f6 100644 --- a/test/intrinsics/gen/step/334303.wgsl +++ b/test/intrinsics/gen/step/334303.wgsl @@ -27,8 +27,9 @@ fn step_334303() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_334303(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.hlsl b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl index ee296d273f..9e76fdc203 100644 --- a/test/intrinsics/gen/step/334303.wgsl.expected.hlsl +++ b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void step_334303() { float3 res = step(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { step_334303(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.msl b/test/intrinsics/gen/step/334303.wgsl.expected.msl index cc538963d9..8594bfcb7a 100644 --- a/test/intrinsics/gen/step/334303.wgsl.expected.msl +++ b/test/intrinsics/gen/step/334303.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void step_334303() { float3 res = step(float3(), float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { step_334303(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.spvasm b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm index 6d91105d57..67f95b841b 100644 --- a/test/intrinsics/gen/step/334303.wgsl.expected.spvasm +++ b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %step_334303 "step_334303" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%step_334303 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Step %12 %12 - OpStore %res %9 +%step_334303 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Step %16 %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %step_334303 + %26 = OpFunctionCall %void %step_334303 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %step_334303 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %step_334303 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %step_334303 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %step_334303 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.wgsl b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl index d14ad043e9..0eb6d5a929 100644 --- a/test/intrinsics/gen/step/334303.wgsl.expected.wgsl +++ b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn step_334303() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_334303(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/e2b337.wgsl b/test/intrinsics/gen/step/e2b337.wgsl index 8e11a80f39..d10ceb5194 100644 --- a/test/intrinsics/gen/step/e2b337.wgsl +++ b/test/intrinsics/gen/step/e2b337.wgsl @@ -27,8 +27,9 @@ fn step_e2b337() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_e2b337(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl index 27f9644603..8faf2362f8 100644 --- a/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void step_e2b337() { float4 res = step(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { step_e2b337(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl index a59fbfe3c6..d35db64bef 100644 --- a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void step_e2b337() { float4 res = step(float4(), float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { step_e2b337(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm index 5221bea09c..96519e648e 100644 --- a/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %step_e2b337 "step_e2b337" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%step_e2b337 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Step %12 %12 - OpStore %res %9 +%step_e2b337 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Step %8 %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %step_e2b337 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %step_e2b337 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %step_e2b337 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %step_e2b337 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %step_e2b337 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl index 2309dbf1a5..28f85f4277 100644 --- a/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn step_e2b337() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { step_e2b337(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/244e2a.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl index 7bb14bfe9f..bbf346fa3e 100644 --- a/test/intrinsics/gen/tan/244e2a.wgsl +++ b/test/intrinsics/gen/tan/244e2a.wgsl @@ -27,8 +27,9 @@ fn tan_244e2a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_244e2a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl index 5044adde2e..747de61d32 100644 --- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tan_244e2a() { float4 res = tan(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { tan_244e2a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl index 1f3a31df28..71c4d77e10 100644 --- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tan_244e2a() { float4 res = tan(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tan_244e2a(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm index 4ad27293ce..15f652755c 100644 --- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tan_244e2a "tan_244e2a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %tan_244e2a = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Tan %12 - OpStore %res %9 + %tan_244e2a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Tan %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %tan_244e2a - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %tan_244e2a + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %tan_244e2a + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %tan_244e2a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %tan_244e2a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl index 56c1b2ddbd..6dbb764d68 100644 --- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tan_244e2a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_244e2a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/2f030e.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl index f0e42585bd..adcab68c55 100644 --- a/test/intrinsics/gen/tan/2f030e.wgsl +++ b/test/intrinsics/gen/tan/2f030e.wgsl @@ -27,8 +27,9 @@ fn tan_2f030e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_2f030e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl index b647df266e..3b7439988f 100644 --- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tan_2f030e() { float res = tan(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { tan_2f030e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl index 19a8b8fd07..10fd660866 100644 --- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tan_2f030e() { float res = tan(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tan_2f030e(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm index ba5b2cede1..53e31dd302 100644 --- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tan_2f030e "tan_2f030e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float - %tan_2f030e = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float + %tan_2f030e = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Tan %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Tan %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %tan_2f030e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %tan_2f030e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %tan_2f030e + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %tan_2f030e + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %tan_2f030e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %tan_2f030e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl index da88b0db80..9a63abac2c 100644 --- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tan_2f030e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_2f030e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/7ea104.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl index c01ac629e9..e9e56f8fe2 100644 --- a/test/intrinsics/gen/tan/7ea104.wgsl +++ b/test/intrinsics/gen/tan/7ea104.wgsl @@ -27,8 +27,9 @@ fn tan_7ea104() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_7ea104(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl index f31a310189..31def878e9 100644 --- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tan_7ea104() { float3 res = tan(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { tan_7ea104(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl index 17676af315..f4ef8364eb 100644 --- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tan_7ea104() { float3 res = tan(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tan_7ea104(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm index 226a7b014b..a7765895a6 100644 --- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tan_7ea104 "tan_7ea104" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %tan_7ea104 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Tan %12 - OpStore %res %9 + %tan_7ea104 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Tan %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %tan_7ea104 + %26 = OpFunctionCall %void %tan_7ea104 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %tan_7ea104 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %tan_7ea104 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %tan_7ea104 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %tan_7ea104 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl index 4e6f0f5df8..da186c5a29 100644 --- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tan_7ea104() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_7ea104(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl index b62fa47e6d..22dec1916c 100644 --- a/test/intrinsics/gen/tan/8ce3e9.wgsl +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl @@ -27,8 +27,9 @@ fn tan_8ce3e9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_8ce3e9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl index ab79f9acab..be458f91b1 100644 --- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tan_8ce3e9() { float2 res = tan(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { tan_8ce3e9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl index bad2f53d2d..89bfdfe871 100644 --- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tan_8ce3e9() { float2 res = tan(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tan_8ce3e9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm index d02318db8c..50360e3ee6 100644 --- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tan_8ce3e9 "tan_8ce3e9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 - %tan_8ce3e9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Tan %12 - OpStore %res %9 + %tan_8ce3e9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Tan %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %tan_8ce3e9 + %26 = OpFunctionCall %void %tan_8ce3e9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %tan_8ce3e9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %tan_8ce3e9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %tan_8ce3e9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %tan_8ce3e9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl index b7b3c291dc..b215d9e442 100644 --- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tan_8ce3e9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tan_8ce3e9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl index 58def07970..5f373d0c1d 100644 --- a/test/intrinsics/gen/tanh/5663c5.wgsl +++ b/test/intrinsics/gen/tanh/5663c5.wgsl @@ -27,8 +27,9 @@ fn tanh_5663c5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_5663c5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl index 6a10df24e5..6579c412fe 100644 --- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tanh_5663c5() { float4 res = tanh(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { tanh_5663c5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl index 326f847d23..421d1a1635 100644 --- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tanh_5663c5() { float4 res = tanh(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tanh_5663c5(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm index 6484100edc..bdf846a5e0 100644 --- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tanh_5663c5 "tanh_5663c5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%tanh_5663c5 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Tanh %12 - OpStore %res %9 +%tanh_5663c5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Tanh %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %tanh_5663c5 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %tanh_5663c5 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %tanh_5663c5 + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %tanh_5663c5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %tanh_5663c5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl index 017fdaa8ad..4869033fcc 100644 --- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tanh_5663c5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_5663c5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl index e832a46a5e..a62cb77617 100644 --- a/test/intrinsics/gen/tanh/5724b3.wgsl +++ b/test/intrinsics/gen/tanh/5724b3.wgsl @@ -27,8 +27,9 @@ fn tanh_5724b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_5724b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl index 09ee1c550b..950b4b9fd6 100644 --- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tanh_5724b3() { float2 res = tanh(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { tanh_5724b3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl index d87dbf73db..90440dac9f 100644 --- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tanh_5724b3() { float2 res = tanh(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tanh_5724b3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm index 573f7ef486..62ff76532d 100644 --- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tanh_5724b3 "tanh_5724b3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%tanh_5724b3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Tanh %12 - OpStore %res %9 +%tanh_5724b3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Tanh %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %tanh_5724b3 + %26 = OpFunctionCall %void %tanh_5724b3 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %tanh_5724b3 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %tanh_5724b3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %tanh_5724b3 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %tanh_5724b3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl index 64efc2b6d5..dd9f0f0195 100644 --- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tanh_5724b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_5724b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl index 5461f604bc..0de6764b90 100644 --- a/test/intrinsics/gen/tanh/9f9fb9.wgsl +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl @@ -27,8 +27,9 @@ fn tanh_9f9fb9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_9f9fb9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl index 981877b70f..c37aa5fea0 100644 --- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tanh_9f9fb9() { float3 res = tanh(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { tanh_9f9fb9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl index 2eac415cda..9e0039be83 100644 --- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tanh_9f9fb9() { float3 res = tanh(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tanh_9f9fb9(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm index 3f448b6e6f..9c4b25d076 100644 --- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tanh_9f9fb9 "tanh_9f9fb9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%tanh_9f9fb9 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Tanh %12 - OpStore %res %9 +%tanh_9f9fb9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Tanh %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %tanh_9f9fb9 + %26 = OpFunctionCall %void %tanh_9f9fb9 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %tanh_9f9fb9 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %tanh_9f9fb9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %tanh_9f9fb9 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %tanh_9f9fb9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl index ff29472595..2851c58e28 100644 --- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tanh_9f9fb9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_9f9fb9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl index 55d3294f79..dbc6f8c03e 100644 --- a/test/intrinsics/gen/tanh/c15fdb.wgsl +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl @@ -27,8 +27,9 @@ fn tanh_c15fdb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_c15fdb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl index 863893507e..ec2388c69f 100644 --- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void tanh_c15fdb() { float res = tanh(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { tanh_c15fdb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl index ca7aebecad..31287f648b 100644 --- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void tanh_c15fdb() { float res = tanh(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { tanh_c15fdb(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm index 250c6b2fb3..a233a16b4d 100644 --- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %tanh_c15fdb "tanh_c15fdb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%tanh_c15fdb = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%tanh_c15fdb = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Tanh %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Tanh %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %tanh_c15fdb - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %tanh_c15fdb - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %tanh_c15fdb + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %tanh_c15fdb + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %tanh_c15fdb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %tanh_c15fdb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl index ecd8766fb7..10ee65c9ef 100644 --- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn tanh_c15fdb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { tanh_c15fdb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl index 718b2a9609..c23bb53c4f 100644 --- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_002b2a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_002b2a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl index d83530e59e..edcde32b3d 100644 --- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_002b2a() { @@ -6,9 +10,10 @@ void textureDimensions_002b2a() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_002b2a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm index 2dc45cf002..e30b842cf2 100644 --- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Sampled1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_002b2a "textureDimensions_002b2a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 1D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_002b2a = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %int %14 %int_0 - OpStore %res %12 +%textureDimensions_002b2a = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %int %18 %int_0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_002b2a + %30 = OpFunctionCall %void %textureDimensions_002b2a + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_002b2a +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_002b2a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_002b2a +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_002b2a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl index 20d2b0f651..1cb02b3e58 100644 --- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_002b2a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_002b2a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl index 69ae40d39e..1e3a598de9 100644 --- a/test/intrinsics/gen/textureDimensions/012b82.wgsl +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_012b82() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_012b82(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl index a192aa3bd2..378682f3c5 100644 --- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_012b82() { @@ -6,9 +10,10 @@ void textureDimensions_012b82() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_012b82(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm index c8b4b79775..0cc033bd86 100644 --- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_012b82 "textureDimensions_012b82" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_012b82 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_012b82 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_012b82 + %32 = OpFunctionCall %void %textureDimensions_012b82 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_012b82 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_012b82 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_012b82 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_012b82 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl index 7a5470d576..8aa6f10e79 100644 --- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_012b82() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_012b82(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl index ba9471bb69..dc402e2b56 100644 --- a/test/intrinsics/gen/textureDimensions/08753d.wgsl +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_08753d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_08753d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl index e414fdbb52..4f438e3baf 100644 --- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_08753d() { @@ -6,9 +10,10 @@ void textureDimensions_08753d() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_08753d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm index 9ab3e11ada..7844189eb1 100644 --- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_08753d "textureDimensions_08753d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_08753d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_08753d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_08753d + %29 = OpFunctionCall %void %textureDimensions_08753d + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_08753d +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_08753d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_08753d +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_08753d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl index dde90103b5..0c068977e0 100644 --- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_08753d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_08753d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl index 6cf4810c2d..2f808b4c9b 100644 --- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_08a62e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_08a62e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl index daea9af714..ce1b1118af 100644 --- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_08a62e() { @@ -6,9 +10,10 @@ void textureDimensions_08a62e() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_08a62e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm index 0eca5b3236..30cf3a571f 100644 --- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_08a62e "textureDimensions_08a62e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_08a62e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_08a62e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_08a62e + %29 = OpFunctionCall %void %textureDimensions_08a62e + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_08a62e +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_08a62e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_08a62e +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_08a62e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl index fad47a1cf7..6b9d4ebfbf 100644 --- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_08a62e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_08a62e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl index 2e4dc907c4..0bf88f37d4 100644 --- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0a5fcf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0a5fcf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl index d269b4861e..214295094b 100644 --- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_0a5fcf() { @@ -6,9 +10,10 @@ void textureDimensions_0a5fcf() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0a5fcf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm index 7f18747195..78cdeabde9 100644 --- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0a5fcf "textureDimensions_0a5fcf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0a5fcf = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_0a5fcf = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_0a5fcf + %32 = OpFunctionCall %void %textureDimensions_0a5fcf + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_0a5fcf +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_0a5fcf OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_0a5fcf +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_0a5fcf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl index 14574cf368..8025f25486 100644 --- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0a5fcf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0a5fcf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl index c74f80fbe2..d192af258e 100644 --- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0bab57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0bab57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl index 74e27fc871..d14bed1d7e 100644 --- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_0bab57() { @@ -6,9 +10,10 @@ void textureDimensions_0bab57() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0bab57(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm index d0652c23a4..5122a7a297 100644 --- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0bab57 "textureDimensions_0bab57" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0bab57 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_0bab57 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_0bab57 + %30 = OpFunctionCall %void %textureDimensions_0bab57 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_0bab57 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_0bab57 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_0bab57 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_0bab57 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl index 3ba0ffc9ed..2a1cdc2d66 100644 --- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0bab57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0bab57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl index d880ebae5c..899abde8ad 100644 --- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0c4772() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0c4772(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl index 6aa502f917..faf837d591 100644 --- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_0c4772() { @@ -6,9 +10,10 @@ void textureDimensions_0c4772() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0c4772(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm index 3c1c1c08da..a84a2c9da6 100644 --- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0c4772 "textureDimensions_0c4772" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0c4772 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_0c4772 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_0c4772 + %30 = OpFunctionCall %void %textureDimensions_0c4772 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_0c4772 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_0c4772 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_0c4772 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_0c4772 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl index 8721c37439..1b29dc5b73 100644 --- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0c4772() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0c4772(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl index 8e54db431b..4b7c35027c 100644 --- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0cce40() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0cce40(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl index 7b1dcc7d40..c6df8d0826 100644 --- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_0cce40() { @@ -6,9 +10,10 @@ void textureDimensions_0cce40() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0cce40(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm index 98ecb89c9d..a86327e4b8 100644 --- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0cce40 "textureDimensions_0cce40" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0cce40 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_0cce40 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_0cce40 + %29 = OpFunctionCall %void %textureDimensions_0cce40 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_0cce40 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_0cce40 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_0cce40 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_0cce40 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl index fd78266740..e1b42278e3 100644 --- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0cce40() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0cce40(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl index 4b75932061..26cb0ec1ae 100644 --- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0cf2ff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0cf2ff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl index 738b5bec7a..b05668823a 100644 --- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_0cf2ff() { @@ -6,9 +10,10 @@ void textureDimensions_0cf2ff() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0cf2ff(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm index 40c71094a0..9a0a27b7e4 100644 --- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0cf2ff "textureDimensions_0cf2ff" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0cf2ff = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_0cf2ff = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_0cf2ff + %31 = OpFunctionCall %void %textureDimensions_0cf2ff + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_0cf2ff +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_0cf2ff OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_0cf2ff +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_0cf2ff OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl index 21b0006753..0dcd6ab7d3 100644 --- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0cf2ff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0cf2ff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl index 0946237a10..5aca3e2b62 100644 --- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0d8b7e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0d8b7e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl index 06bf8728a8..4688a7ef96 100644 --- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_0d8b7e() { @@ -6,9 +10,10 @@ void textureDimensions_0d8b7e() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0d8b7e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm index e8b582b0ff..81c70b00e0 100644 --- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0d8b7e "textureDimensions_0d8b7e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0d8b7e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_0d8b7e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_0d8b7e + %33 = OpFunctionCall %void %textureDimensions_0d8b7e + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_0d8b7e +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_0d8b7e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_0d8b7e +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_0d8b7e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl index c0c36bfe7c..a7568176c4 100644 --- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0d8b7e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0d8b7e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl index a242d8ef25..4c93c0e387 100644 --- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0e32ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0e32ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl index 7146aa7d65..29e863d4ff 100644 --- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_0e32ee() { @@ -6,9 +10,10 @@ void textureDimensions_0e32ee() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0e32ee(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm index c53b4b1af1..74a4736526 100644 --- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0e32ee "textureDimensions_0e32ee" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0e32ee = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_0e32ee = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_0e32ee + %31 = OpFunctionCall %void %textureDimensions_0e32ee + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_0e32ee +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_0e32ee OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_0e32ee +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_0e32ee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl index b32e2ea291..d22f78ef85 100644 --- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0e32ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0e32ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl index a2a7a525be..a83e365115 100644 --- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl +++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_0f3c50() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0f3c50(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl index abf7390688..9421283fbb 100644 --- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_0f3c50() { @@ -6,9 +10,10 @@ void textureDimensions_0f3c50() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_0f3c50(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm index 0091be231b..34cbe26368 100644 --- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_0f3c50 "textureDimensions_0f3c50" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_0f3c50 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_0 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_0f3c50 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_0f3c50 + %33 = OpFunctionCall %void %textureDimensions_0f3c50 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_0f3c50 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_0f3c50 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_0f3c50 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_0f3c50 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl index ce1a4f3560..b83a934c36 100644 --- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_0f3c50() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_0f3c50(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl index a460387157..bdbed6d17e 100644 --- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1147d6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1147d6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl index b1318e5ca7..7d82574123 100644 --- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_1147d6() { @@ -6,9 +10,10 @@ void textureDimensions_1147d6() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1147d6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm index 7c586a912e..ca44195747 100644 --- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1147d6 "textureDimensions_1147d6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1147d6 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_1147d6 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_1147d6 + %32 = OpFunctionCall %void %textureDimensions_1147d6 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_1147d6 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_1147d6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_1147d6 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_1147d6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl index d510726fe2..46318cefd7 100644 --- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1147d6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1147d6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl index b846121413..de1197dee0 100644 --- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1191a5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1191a5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl index 561d7d4128..b07629e128 100644 --- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_1191a5() { @@ -6,9 +10,10 @@ void textureDimensions_1191a5() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1191a5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm index c94df748a2..90f0304df8 100644 --- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1191a5 "textureDimensions_1191a5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1191a5 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v2int %16 %int_0 - OpStore %res %13 +%textureDimensions_1191a5 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v2int %20 %int_0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_1191a5 + %32 = OpFunctionCall %void %textureDimensions_1191a5 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_1191a5 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_1191a5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_1191a5 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_1191a5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl index d17c8a98cd..a90f6c5795 100644 --- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1191a5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1191a5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl index e99292bba4..a96b8149fd 100644 --- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl +++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_12c9bb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_12c9bb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl index e2fbea5e38..fbcb7c7175 100644 --- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_12c9bb() { @@ -6,9 +10,10 @@ void textureDimensions_12c9bb() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_12c9bb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm index ff69832d91..599497a863 100644 --- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_12c9bb "textureDimensions_12c9bb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_12c9bb = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v2int %15 %int_1 - OpStore %res %12 +%textureDimensions_12c9bb = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_12c9bb + %31 = OpFunctionCall %void %textureDimensions_12c9bb + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_12c9bb +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_12c9bb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_12c9bb +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_12c9bb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl index a9e20d614d..c912411c61 100644 --- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_12c9bb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_12c9bb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl index f0dbaf2220..15d37f6fc6 100644 --- a/test/intrinsics/gen/textureDimensions/147998.wgsl +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_147998() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_147998(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl index eff5508cff..ccf858b227 100644 --- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_147998() { @@ -6,9 +10,10 @@ void textureDimensions_147998() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_147998(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm index 2295a195bd..83e696cb50 100644 --- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_147998 "textureDimensions_147998" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_147998 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_147998 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_147998 + %30 = OpFunctionCall %void %textureDimensions_147998 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_147998 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_147998 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_147998 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_147998 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl index cc32bc401b..f5192034bb 100644 --- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_147998() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_147998(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl index 55224db90d..87b951f564 100644 --- a/test/intrinsics/gen/textureDimensions/16036c.wgsl +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_16036c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_16036c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl index f358c2a5fa..2b718ebb89 100644 --- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_16036c() { @@ -6,9 +10,10 @@ void textureDimensions_16036c() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_16036c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm index 8498e15166..f00ebb9408 100644 --- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_16036c "textureDimensions_16036c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_16036c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_16036c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_16036c + %32 = OpFunctionCall %void %textureDimensions_16036c + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_16036c +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_16036c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_16036c +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_16036c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl index 3972668f4e..6b679ac258 100644 --- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_16036c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_16036c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl index ae55f61ad6..81346887bd 100644 --- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_168fcc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_168fcc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl index 45811efd15..f1b9dffc79 100644 --- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_168fcc() { @@ -6,9 +10,10 @@ void textureDimensions_168fcc() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_168fcc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm index b9b2a43a68..e1c7c11599 100644 --- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_168fcc "textureDimensions_168fcc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_168fcc = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_168fcc = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_168fcc + %30 = OpFunctionCall %void %textureDimensions_168fcc + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_168fcc +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_168fcc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_168fcc +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_168fcc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl index 50cebb341a..b66918a053 100644 --- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_168fcc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_168fcc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl index 9579b95a50..ec5dc3db0a 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl +++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_183b3e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_183b3e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl index 764248cbb6..0aee4e9062 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_183b3e() { @@ -6,9 +10,10 @@ void textureDimensions_183b3e() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_183b3e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm index 3a6eb226ca..cd4d25b8e2 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_183b3e "textureDimensions_183b3e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_183b3e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %16 = OpImageQuerySizeLod %v3int %17 %int_0 - %13 = OpVectorShuffle %v3int %16 %16 0 1 1 - OpStore %res %13 +%textureDimensions_183b3e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %20 = OpImageQuerySizeLod %v3int %21 %int_0 + %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_183b3e + %33 = OpFunctionCall %void %textureDimensions_183b3e + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_183b3e +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_183b3e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_183b3e +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_183b3e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl index d2bc85f76d..e42d888183 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_183b3e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_183b3e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl index d4582537dd..187a60734f 100644 --- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_18bd57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_18bd57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl index 14127efed3..343ba4516f 100644 --- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_18bd57() { @@ -6,9 +10,10 @@ void textureDimensions_18bd57() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_18bd57(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm index 70b169b06f..c0c23cbb62 100644 --- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_18bd57 "textureDimensions_18bd57" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,36 +35,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_18bd57 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_18bd57 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_18bd57 + %33 = OpFunctionCall %void %textureDimensions_18bd57 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_18bd57 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_18bd57 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_18bd57 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_18bd57 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl index 01698c5e18..6eb56a5b19 100644 --- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_18bd57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_18bd57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl index 21137dc607..9d460ddc38 100644 --- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_19bffc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_19bffc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl index dbcc08dbfb..abf1f042b6 100644 --- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_19bffc() { @@ -6,9 +10,10 @@ void textureDimensions_19bffc() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_19bffc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm index 5d81c19bc7..81576575ca 100644 --- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_19bffc "textureDimensions_19bffc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_19bffc = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_19bffc = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_19bffc + %30 = OpFunctionCall %void %textureDimensions_19bffc + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_19bffc +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_19bffc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_19bffc +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_19bffc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl index e0135b0cca..b484dbe047 100644 --- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_19bffc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_19bffc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl index 30f31eade0..3f45fde3c2 100644 --- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1a58e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1a58e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl index 565d342b9e..7e5c2b4e3b 100644 --- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_1a58e7() { @@ -6,9 +10,10 @@ void textureDimensions_1a58e7() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1a58e7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm index 504d710aef..53bda8e75d 100644 --- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1a58e7 "textureDimensions_1a58e7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1a58e7 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_1a58e7 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_1a58e7 + %32 = OpFunctionCall %void %textureDimensions_1a58e7 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_1a58e7 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_1a58e7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_1a58e7 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_1a58e7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl index 2706764f93..d8ec0223b8 100644 --- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1a58e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1a58e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl index b39067c6fb..b4337f5afc 100644 --- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1aa199() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1aa199(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl index bd8d2e1b44..1c77f9f709 100644 --- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_1aa199() { @@ -6,9 +10,10 @@ void textureDimensions_1aa199() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1aa199(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm index 682bb7819b..721e60a779 100644 --- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1aa199 "textureDimensions_1aa199" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1aa199 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_1aa199 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_1aa199 + %32 = OpFunctionCall %void %textureDimensions_1aa199 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_1aa199 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_1aa199 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_1aa199 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_1aa199 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl index e04a103d8b..07dcdb5a46 100644 --- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1aa199() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1aa199(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl index 396abe2d5e..b14ab12739 100644 --- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1b71f0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1b71f0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl index af31554aad..c57db86f35 100644 --- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_1b71f0() { @@ -6,9 +10,10 @@ void textureDimensions_1b71f0() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1b71f0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm index 1a854e4ae8..1bd6793f86 100644 --- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1b71f0 "textureDimensions_1b71f0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1b71f0 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_1b71f0 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_1b71f0 + %30 = OpFunctionCall %void %textureDimensions_1b71f0 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_1b71f0 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_1b71f0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_1b71f0 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_1b71f0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl index e9f02beed3..d2d1fde840 100644 --- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1b71f0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1b71f0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl index 29be560bf5..eef5ba34b1 100644 --- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1d6c26() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1d6c26(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl index a4964426c2..f9e2114d62 100644 --- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_1d6c26() { @@ -6,9 +10,10 @@ void textureDimensions_1d6c26() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1d6c26(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm index 91f238ada1..211100fc2a 100644 --- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1d6c26 "textureDimensions_1d6c26" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1d6c26 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_1d6c26 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_1d6c26 + %32 = OpFunctionCall %void %textureDimensions_1d6c26 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_1d6c26 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_1d6c26 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_1d6c26 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_1d6c26 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl index fa330093e4..7ab9a3780b 100644 --- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1d6c26() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1d6c26(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl index 2234edafe2..11809060fc 100644 --- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1e189c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1e189c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl index be9b5ff554..f8ba10426a 100644 --- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_1e189c() { @@ -6,9 +10,10 @@ void textureDimensions_1e189c() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1e189c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm index eb6508a2f6..1445365910 100644 --- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1e189c "textureDimensions_1e189c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1e189c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_1e189c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_1e189c + %30 = OpFunctionCall %void %textureDimensions_1e189c + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_1e189c +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_1e189c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_1e189c +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_1e189c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl index 7959299deb..4e8b5f6747 100644 --- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1e189c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1e189c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl index e109c3c2ba..5d2b2cb714 100644 --- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1e9e39() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1e9e39(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl index a77efc4859..d4dcf6aea8 100644 --- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_1e9e39() { @@ -6,9 +10,10 @@ void textureDimensions_1e9e39() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1e9e39(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm index 33b27728e9..8deedb378f 100644 --- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1e9e39 "textureDimensions_1e9e39" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1e9e39 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_1e9e39 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_1e9e39 + %29 = OpFunctionCall %void %textureDimensions_1e9e39 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_1e9e39 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_1e9e39 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_1e9e39 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_1e9e39 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl index 7aee504e6a..7cd094b870 100644 --- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1e9e39() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1e9e39(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl index a1468f4be9..9b5dd983c8 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1ebd6a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1ebd6a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl index 8cd7608bcc..6787aabfaa 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_1ebd6a() { @@ -6,9 +10,10 @@ void textureDimensions_1ebd6a() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1ebd6a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm index dd9af14056..78971ba8e2 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1ebd6a "textureDimensions_1ebd6a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %22 = OpConstantNull %v3int + %26 = OpConstantNull %v3int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1ebd6a = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %22 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySizeLod %v2int %18 %int_0 - %13 = OpVectorShuffle %v3int %16 %16 0 1 1 - OpStore %res %13 +%textureDimensions_1ebd6a = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %26 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySizeLod %v2int %22 %int_0 + %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureDimensions_1ebd6a + %34 = OpFunctionCall %void %textureDimensions_1ebd6a + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_1ebd6a +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_1ebd6a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureDimensions_1ebd6a +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureDimensions_1ebd6a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl index da5ca1c0b7..87878e8460 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1ebd6a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1ebd6a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl index 333146a878..b5d6911253 100644 --- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl +++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_1f20c5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1f20c5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl index bc07afa231..5246f41c9b 100644 --- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_1f20c5() { @@ -6,9 +10,10 @@ void textureDimensions_1f20c5() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_1f20c5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm index c7c82c8914..bee122d060 100644 --- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_1f20c5 "textureDimensions_1f20c5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %22 = OpConstantNull %v2int + %26 = OpConstantNull %v2int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1f20c5 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %22 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySizeLod %v3int %18 %int_0 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_1f20c5 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %26 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySizeLod %v3int %22 %int_0 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureDimensions_1f20c5 + %34 = OpFunctionCall %void %textureDimensions_1f20c5 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_1f20c5 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_1f20c5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureDimensions_1f20c5 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureDimensions_1f20c5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl index dce90c102a..0d580f7a3a 100644 --- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_1f20c5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_1f20c5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl index 053eab16e7..1eff7e26d6 100644 --- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_214b7b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_214b7b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl index e3c3205e82..422b8147d8 100644 --- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_214b7b() { @@ -6,9 +10,10 @@ void textureDimensions_214b7b() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_214b7b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm index 19b3b6deb4..6179d333d5 100644 --- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm @@ -1,22 +1,25 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_214b7b "textureDimensions_214b7b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_214b7b = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_214b7b = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_214b7b + %29 = OpFunctionCall %void %textureDimensions_214b7b + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_214b7b +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_214b7b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_214b7b +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_214b7b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl index 5a63062e9c..b88578623f 100644 --- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_214b7b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_214b7b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl index 042c0ed45e..c7f63545ba 100644 --- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_214dd4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_214dd4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl index 9a51609768..75222f5903 100644 --- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_214dd4() { @@ -6,9 +10,10 @@ void textureDimensions_214dd4() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_214dd4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm index 3db1b54cb2..9b8ac3246b 100644 --- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_214dd4 "textureDimensions_214dd4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_214dd4 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_214dd4 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_214dd4 + %30 = OpFunctionCall %void %textureDimensions_214dd4 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_214dd4 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_214dd4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_214dd4 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_214dd4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl index de7e3bbc84..760b456248 100644 --- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_214dd4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_214dd4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl b/test/intrinsics/gen/textureDimensions/267788.wgsl index 83b5d07b88..88df32ec15 100644 --- a/test/intrinsics/gen/textureDimensions/267788.wgsl +++ b/test/intrinsics/gen/textureDimensions/267788.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_267788() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_267788(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl index aa6b355b58..be0ec88c45 100644 --- a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_267788() { @@ -6,9 +10,10 @@ void textureDimensions_267788() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_267788(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm index d0154aa147..4b3cbc2322 100644 --- a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_267788 "textureDimensions_267788" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %22 = OpConstantNull %v2int + %26 = OpConstantNull %v2int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_267788 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %22 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySizeLod %v3int %18 %int_1 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_267788 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %26 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySizeLod %v3int %22 %int_1 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureDimensions_267788 + %34 = OpFunctionCall %void %textureDimensions_267788 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_267788 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_267788 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureDimensions_267788 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureDimensions_267788 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl index 177cdb29a4..87bd669309 100644 --- a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_267788() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_267788(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl index 445a6d2d77..9988127089 100644 --- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_26bdfa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_26bdfa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl index f6e82ab906..2b9a1f7f02 100644 --- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_26bdfa() { @@ -6,9 +10,10 @@ void textureDimensions_26bdfa() { int3 res = tint_tmp.xyz; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_26bdfa(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm index 80e60286ac..c851fa48f5 100644 --- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_26bdfa "textureDimensions_26bdfa" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_26bdfa = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v3int %15 %int_1 - OpStore %res %12 +%textureDimensions_26bdfa = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v3int %19 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_26bdfa + %31 = OpFunctionCall %void %textureDimensions_26bdfa + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_26bdfa +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_26bdfa OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_26bdfa +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_26bdfa OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl index 10d89c335e..6c92d3f269 100644 --- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_26bdfa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_26bdfa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl index e197ab20e6..ceb229ce50 100644 --- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_26ef6c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_26ef6c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl index 9e11e83f82..61a8a4238f 100644 --- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_26ef6c() { @@ -6,9 +10,10 @@ void textureDimensions_26ef6c() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_26ef6c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm index 26609c2afb..a02bdc1d24 100644 --- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_26ef6c "textureDimensions_26ef6c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_26ef6c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_26ef6c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_26ef6c + %33 = OpFunctionCall %void %textureDimensions_26ef6c + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_26ef6c +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_26ef6c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_26ef6c +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_26ef6c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl index ccf7e79b73..83295f3108 100644 --- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_26ef6c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_26ef6c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl index e10201e37b..7bc99f6285 100644 --- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_2ad087() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2ad087(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl index 82c4e11237..e9602c34cd 100644 --- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_2ad087() { @@ -6,9 +10,10 @@ void textureDimensions_2ad087() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_2ad087(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm index 74f5e24a22..d4c7fd8da3 100644 --- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_2ad087 "textureDimensions_2ad087" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_2ad087 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_2ad087 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_2ad087 + %30 = OpFunctionCall %void %textureDimensions_2ad087 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_2ad087 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_2ad087 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_2ad087 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_2ad087 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl index 095ee44b69..c9e1f1698e 100644 --- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_2ad087() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2ad087(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl index 8a96df2658..bb7839395b 100644 --- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_2d32ae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2d32ae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl index 83d3b36ef6..e7f0854d0d 100644 --- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_2d32ae() { @@ -6,9 +10,10 @@ void textureDimensions_2d32ae() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_2d32ae(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm index 96c6b4ca15..43bf92d1b0 100644 --- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_2d32ae "textureDimensions_2d32ae" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_2d32ae = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_2d32ae = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_2d32ae + %31 = OpFunctionCall %void %textureDimensions_2d32ae + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_2d32ae +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_2d32ae OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_2d32ae +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_2d32ae OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl index 61b01c9343..8ad08a8a44 100644 --- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_2d32ae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2d32ae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl index fc5760d07e..7688adb19e 100644 --- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_2e0662() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2e0662(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl index 30d3b5361a..014e3216e8 100644 --- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_2e0662() { @@ -6,9 +10,10 @@ void textureDimensions_2e0662() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_2e0662(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm index 8b365dab5a..c28f83613a 100644 --- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_2e0662 "textureDimensions_2e0662" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_2e0662 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_2e0662 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_2e0662 + %30 = OpFunctionCall %void %textureDimensions_2e0662 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_2e0662 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_2e0662 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_2e0662 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_2e0662 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl index 39f4bbddb6..6ce2d7643c 100644 --- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_2e0662() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2e0662(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl index 88c2c9f054..fa584db3c7 100644 --- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_2efa05() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2efa05(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl index 5175bdd76b..a3c3f0edc8 100644 --- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_2efa05() { @@ -6,9 +10,10 @@ void textureDimensions_2efa05() { int3 res = tint_tmp.xyz; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_2efa05(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm index ecba548352..6ed8b5b4ff 100644 --- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_2efa05 "textureDimensions_2efa05" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_2efa05 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v3int %16 %int_1 - OpStore %res %13 +%textureDimensions_2efa05 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v3int %20 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_2efa05 + %32 = OpFunctionCall %void %textureDimensions_2efa05 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_2efa05 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_2efa05 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_2efa05 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_2efa05 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl index 02c2e5aeb4..3b902cc2e6 100644 --- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_2efa05() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2efa05(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl index cc718aaff2..bb7115b24b 100644 --- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_2f289f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2f289f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl index ee4cc4c8a1..72b6b64b95 100644 --- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_2f289f() { @@ -6,9 +10,10 @@ void textureDimensions_2f289f() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_2f289f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm index 4d2be754d7..ffe6d7ee29 100644 --- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_2f289f "textureDimensions_2f289f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_2f289f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_2f289f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_2f289f + %30 = OpFunctionCall %void %textureDimensions_2f289f + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_2f289f +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_2f289f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_2f289f +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_2f289f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl index cb95ece6b8..64ae07464f 100644 --- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_2f289f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2f289f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl index dfa4db2ea8..d1e868cd77 100644 --- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_2fe1cc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2fe1cc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl index a2d49c88b7..54c9ce32bb 100644 --- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_2fe1cc() { @@ -6,9 +10,10 @@ void textureDimensions_2fe1cc() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_2fe1cc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm index 76ece0db86..0af8187060 100644 --- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_2fe1cc "textureDimensions_2fe1cc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_2fe1cc = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v2int %15 %int_1 - OpStore %res %12 +%textureDimensions_2fe1cc = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_2fe1cc + %31 = OpFunctionCall %void %textureDimensions_2fe1cc + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_2fe1cc +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_2fe1cc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_2fe1cc +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_2fe1cc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl index 215ce6a4e2..d27758b0d7 100644 --- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_2fe1cc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_2fe1cc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl index 29b4ad5270..cc8ae7989a 100644 --- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_318ecc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_318ecc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl index ad7854dfc2..4976ca7610 100644 --- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_318ecc() { @@ -6,9 +10,10 @@ void textureDimensions_318ecc() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_318ecc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm index 9cd91c9f07..17a4e273fc 100644 --- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_318ecc "textureDimensions_318ecc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_318ecc = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_318ecc = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_318ecc + %30 = OpFunctionCall %void %textureDimensions_318ecc + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_318ecc +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_318ecc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_318ecc +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_318ecc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl index 4332a639c7..1c8d987670 100644 --- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_318ecc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_318ecc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl index 7d8e7bab00..5b401907d1 100644 --- a/test/intrinsics/gen/textureDimensions/340d06.wgsl +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_340d06() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_340d06(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl index 341d62a2e9..700259cacf 100644 --- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_340d06() { @@ -6,9 +10,10 @@ void textureDimensions_340d06() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_340d06(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm index 5ededabe7c..f66631584e 100644 --- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_340d06 "textureDimensions_340d06" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_340d06 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_340d06 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_340d06 + %31 = OpFunctionCall %void %textureDimensions_340d06 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_340d06 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_340d06 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_340d06 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_340d06 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl index aca58adc9d..b2d0826ffc 100644 --- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_340d06() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_340d06(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl index a6f3ad99b7..71bb78fee4 100644 --- a/test/intrinsics/gen/textureDimensions/398e30.wgsl +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_398e30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_398e30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl index 43f9e21a11..7db71a80e9 100644 --- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_398e30() { @@ -6,9 +10,10 @@ void textureDimensions_398e30() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_398e30(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm index d2c4d31eb0..88fb12c30d 100644 --- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_398e30 "textureDimensions_398e30" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_398e30 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_398e30 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_398e30 + %33 = OpFunctionCall %void %textureDimensions_398e30 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_398e30 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_398e30 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_398e30 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_398e30 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl index 50376ffad8..5d0bac4f7f 100644 --- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_398e30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_398e30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl index a06623f53f..ccb385e3ec 100644 --- a/test/intrinsics/gen/textureDimensions/39a600.wgsl +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_39a600() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_39a600(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl index bb63468551..630e3fc765 100644 --- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_39a600() { @@ -6,9 +10,10 @@ void textureDimensions_39a600() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_39a600(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm index b5f190c29a..c364050335 100644 --- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_39a600 "textureDimensions_39a600" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_39a600 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_39a600 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_39a600 + %32 = OpFunctionCall %void %textureDimensions_39a600 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_39a600 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_39a600 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_39a600 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_39a600 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl index 5915c37c63..ea6c5b2291 100644 --- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_39a600() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_39a600(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl index ad3a697aba..9e93d06d8f 100644 --- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_3a94ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3a94ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl index 984a409a51..3b41938f62 100644 --- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_3a94ea() { @@ -6,9 +10,10 @@ void textureDimensions_3a94ea() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_3a94ea(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm index e1132c36b4..36d52b7d54 100644 --- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_3a94ea "textureDimensions_3a94ea" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_3a94ea = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_3a94ea = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_3a94ea + %31 = OpFunctionCall %void %textureDimensions_3a94ea + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_3a94ea +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_3a94ea OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_3a94ea +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_3a94ea OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl index f1acdc1712..f369f54666 100644 --- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_3a94ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3a94ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl index e9735cee84..e6f1753387 100644 --- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_3aca08() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3aca08(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl index 5a88e3b81a..9584a88a51 100644 --- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_3aca08() { @@ -6,9 +10,10 @@ void textureDimensions_3aca08() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_3aca08(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm index a191b3ef3a..5cd7281600 100644 --- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_3aca08 "textureDimensions_3aca08" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_3aca08 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_3aca08 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_3aca08 + %29 = OpFunctionCall %void %textureDimensions_3aca08 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_3aca08 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_3aca08 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_3aca08 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_3aca08 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl index 2c8cb959e4..fbb8bf812e 100644 --- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_3aca08() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3aca08(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl index 30d77c0c0b..99b92efdf8 100644 --- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_3c5ad8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3c5ad8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl index 15ccdf1b0d..a3b9ba6cb6 100644 --- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_3c5ad8() { @@ -6,9 +10,10 @@ void textureDimensions_3c5ad8() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_3c5ad8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm index 90d93e522c..c6cb7d8392 100644 --- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_3c5ad8 "textureDimensions_3c5ad8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_3c5ad8 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_3c5ad8 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_3c5ad8 + %30 = OpFunctionCall %void %textureDimensions_3c5ad8 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_3c5ad8 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_3c5ad8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_3c5ad8 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_3c5ad8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl index ea66097a3e..5f25817e67 100644 --- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_3c5ad8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3c5ad8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl index f09f6f38e6..b20a3a4840 100644 --- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_3d5817() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3d5817(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl index 28ac7bf994..d54a0837cd 100644 --- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_3d5817() { @@ -6,9 +10,10 @@ void textureDimensions_3d5817() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_3d5817(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm index f33f81e348..e617ef651c 100644 --- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_3d5817 "textureDimensions_3d5817" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_3d5817 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_3d5817 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_3d5817 + %30 = OpFunctionCall %void %textureDimensions_3d5817 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_3d5817 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_3d5817 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_3d5817 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_3d5817 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl index 21e8ab0fbe..981b928f2e 100644 --- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_3d5817() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3d5817(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl index ab806b3bda..381f3fce1a 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl +++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_3e0403() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3e0403(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl index bdad7cf7d9..6f38405e79 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_3e0403() { @@ -6,9 +10,10 @@ void textureDimensions_3e0403() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_3e0403(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm index 41e422de85..70fa4731fc 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_3e0403 "textureDimensions_3e0403" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_3e0403 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %16 %int_0 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_3e0403 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %20 %int_0 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_3e0403 + %32 = OpFunctionCall %void %textureDimensions_3e0403 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_3e0403 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_3e0403 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_3e0403 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_3e0403 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl index 769dcc4db7..a9a3da0cf4 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_3e0403() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3e0403(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl index 14d0b6381e..e9eac6874f 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl +++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_3e626d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3e626d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl index a279501081..d71ed5400a 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_3e626d() { @@ -6,9 +10,10 @@ void textureDimensions_3e626d() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_3e626d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm index 056eb243cd..b8f6b671bc 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_3e626d "textureDimensions_3e626d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_3e626d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %16 %int_1 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_3e626d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %20 %int_1 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_3e626d + %32 = OpFunctionCall %void %textureDimensions_3e626d + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_3e626d +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_3e626d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_3e626d +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_3e626d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl index 1fb3dbd42e..cbe958c160 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_3e626d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_3e626d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl index f8f4dd46f1..fcef286a41 100644 --- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_40bc10() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_40bc10(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl index 5a4ba74792..8a30fc19fc 100644 --- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_40bc10() { @@ -6,9 +10,10 @@ void textureDimensions_40bc10() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_40bc10(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm index 228f0b5deb..2d5abf4034 100644 --- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_40bc10 "textureDimensions_40bc10" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_40bc10 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_40bc10 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_40bc10 + %30 = OpFunctionCall %void %textureDimensions_40bc10 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_40bc10 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_40bc10 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_40bc10 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_40bc10 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl index 0727714fe9..22ba5eee79 100644 --- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_40bc10() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_40bc10(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl index f451b22179..7eff83a044 100644 --- a/test/intrinsics/gen/textureDimensions/423f99.wgsl +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_423f99() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_423f99(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl index 2896dccad8..17a6923b13 100644 --- a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_423f99() { @@ -6,9 +10,10 @@ void textureDimensions_423f99() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_423f99(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm index 75aeca4ae9..b6a2c252b0 100644 --- a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Sampled1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_423f99 "textureDimensions_423f99" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 1D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_423f99 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %int %14 %int_0 - OpStore %res %13 +%textureDimensions_423f99 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %int %18 %int_0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_423f99 + %30 = OpFunctionCall %void %textureDimensions_423f99 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_423f99 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_423f99 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_423f99 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_423f99 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl index 1b008ff3d8..54fca497e9 100644 --- a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_423f99() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_423f99(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl index 1d1c2ef5b8..565b180eab 100644 --- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_4267ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_4267ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl index aef602da9b..ff9767fc79 100644 --- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_4267ee() { @@ -6,9 +10,10 @@ void textureDimensions_4267ee() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_4267ee(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm index 5e24b4ebc8..e5b6e92028 100644 --- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_4267ee "textureDimensions_4267ee" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_4267ee = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_4267ee = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_4267ee + %30 = OpFunctionCall %void %textureDimensions_4267ee + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_4267ee +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_4267ee OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_4267ee +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_4267ee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl index 05b48affb9..f548fe486c 100644 --- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_4267ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_4267ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl index d2454e4f53..a5c2e7dd18 100644 --- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_42d4e6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_42d4e6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl index 6fc1b1a198..80fa6e9dac 100644 --- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_42d4e6() { @@ -6,9 +10,10 @@ void textureDimensions_42d4e6() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_42d4e6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm index 1291134b7b..572fcb0263 100644 --- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_42d4e6 "textureDimensions_42d4e6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_42d4e6 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_42d4e6 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_42d4e6 + %29 = OpFunctionCall %void %textureDimensions_42d4e6 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_42d4e6 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_42d4e6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_42d4e6 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_42d4e6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl index 92708fb50d..d218c7b233 100644 --- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_42d4e6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_42d4e6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl index 937d79b866..f1bb4e6a8a 100644 --- a/test/intrinsics/gen/textureDimensions/441392.wgsl +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_441392() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_441392(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl index 67d2344aa3..2b0e4164a7 100644 --- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_441392() { @@ -6,9 +10,10 @@ void textureDimensions_441392() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_441392(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm index fb56b4fb1d..1fb6b0f005 100644 --- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm @@ -1,22 +1,25 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_441392 "textureDimensions_441392" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -32,33 +36,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_441392 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_441392 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_441392 + %30 = OpFunctionCall %void %textureDimensions_441392 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_441392 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_441392 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_441392 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_441392 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl index 432e612b14..19693a983c 100644 --- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_441392() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_441392(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl index 60991cd09b..2ef0482719 100644 --- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_48cb89() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_48cb89(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl index 9f45377b58..6cdc61b11e 100644 --- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_48cb89() { @@ -6,9 +10,10 @@ void textureDimensions_48cb89() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_48cb89(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm index c149ebe117..bcca1a08ce 100644 --- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_48cb89 "textureDimensions_48cb89" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_48cb89 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_48cb89 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_48cb89 + %30 = OpFunctionCall %void %textureDimensions_48cb89 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_48cb89 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_48cb89 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_48cb89 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_48cb89 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl index aaa4c33071..5fc20b1277 100644 --- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_48cb89() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_48cb89(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl index 38ecb4d51f..3dd5ca7369 100644 --- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_48cbb2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_48cbb2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl index 979d34f67d..6862ef8cc2 100644 --- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_48cbb2() { @@ -6,9 +10,10 @@ void textureDimensions_48cbb2() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_48cbb2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm index 54fe42739c..3aaea4efdc 100644 --- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_48cbb2 "textureDimensions_48cbb2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_48cbb2 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_48cbb2 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_48cbb2 + %32 = OpFunctionCall %void %textureDimensions_48cbb2 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_48cbb2 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_48cbb2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_48cbb2 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_48cbb2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl index 180ebcf6c2..c9875415c9 100644 --- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_48cbb2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_48cbb2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl index 9e24a9ebfd..971c339e7f 100644 --- a/test/intrinsics/gen/textureDimensions/48f360.wgsl +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_48f360() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_48f360(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl index 9fbc6c7960..91c03e9d3c 100644 --- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_48f360() { @@ -6,9 +10,10 @@ void textureDimensions_48f360() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_48f360(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm index b86a2ec3d6..48c69ba384 100644 --- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_48f360 "textureDimensions_48f360" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_48f360 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_48f360 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_48f360 + %30 = OpFunctionCall %void %textureDimensions_48f360 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_48f360 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_48f360 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_48f360 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_48f360 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl index 3fa6ac8c46..25c40cd041 100644 --- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_48f360() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_48f360(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl index 25adf507be..e0cef32c10 100644 --- a/test/intrinsics/gen/textureDimensions/49d274.wgsl +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_49d274() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_49d274(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl index 1523867b20..dd20f999d1 100644 --- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_49d274() { @@ -6,9 +10,10 @@ void textureDimensions_49d274() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_49d274(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm index 099c090660..94abc18bcd 100644 --- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_49d274 "textureDimensions_49d274" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,35 +35,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_49d274 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_49d274 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_49d274 + %32 = OpFunctionCall %void %textureDimensions_49d274 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_49d274 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_49d274 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_49d274 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_49d274 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl index 3a08eceb46..2308b26025 100644 --- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_49d274() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_49d274(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl index fe40ade611..8e8a9c7d65 100644 --- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_4df9a8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_4df9a8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl index 1203833d4b..86ee9dbba4 100644 --- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_4df9a8() { @@ -6,9 +10,10 @@ void textureDimensions_4df9a8() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_4df9a8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm index 2aa1708a9f..91dc89d6de 100644 --- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm @@ -1,22 +1,25 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_4df9a8 "textureDimensions_4df9a8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -32,33 +36,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_4df9a8 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_4df9a8 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_4df9a8 + %30 = OpFunctionCall %void %textureDimensions_4df9a8 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_4df9a8 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_4df9a8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_4df9a8 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_4df9a8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl index 7c597ef713..f29f9ac1a7 100644 --- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_4df9a8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_4df9a8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl index 3d070db896..094f049647 100644 --- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_55b23e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_55b23e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl index b5954430c2..85b4ecf9a5 100644 --- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_55b23e() { @@ -6,9 +10,10 @@ void textureDimensions_55b23e() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_55b23e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm index 4899a5fbde..e1da3235a3 100644 --- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm @@ -1,22 +1,25 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_55b23e "textureDimensions_55b23e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_55b23e = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_55b23e = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_55b23e + %29 = OpFunctionCall %void %textureDimensions_55b23e + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_55b23e +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_55b23e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_55b23e +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_55b23e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl index bb617face5..fecc1a3b46 100644 --- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_55b23e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_55b23e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl index 479a5c5d07..1c14f27e08 100644 --- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_56ccfa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_56ccfa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl index f6855febed..e90beece8e 100644 --- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_56ccfa() { @@ -6,9 +10,10 @@ void textureDimensions_56ccfa() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_56ccfa(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm index 0cc05de6b7..2316a22113 100644 --- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_56ccfa "textureDimensions_56ccfa" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_56ccfa = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_56ccfa = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_56ccfa + %30 = OpFunctionCall %void %textureDimensions_56ccfa + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_56ccfa +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_56ccfa OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_56ccfa +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_56ccfa OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl index caa5fca395..4523c91761 100644 --- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_56ccfa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_56ccfa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl b/test/intrinsics/gen/textureDimensions/579629.wgsl index 19fb810872..f4192e544b 100644 --- a/test/intrinsics/gen/textureDimensions/579629.wgsl +++ b/test/intrinsics/gen/textureDimensions/579629.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_579629() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_579629(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl index 797af6b740..a45f676663 100644 --- a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureDimensions_579629() { @@ -6,9 +10,10 @@ void textureDimensions_579629() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_579629(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm index 7de9341f11..097454698b 100644 --- a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_579629 "textureDimensions_579629" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_579629 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_579629 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_579629 + %31 = OpFunctionCall %void %textureDimensions_579629 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_579629 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_579629 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_579629 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_579629 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl index 2b6608f73e..3ee34a3a78 100644 --- a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_579629() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_579629(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl index 7f4e08fa09..df96e95d4b 100644 --- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_57da0b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_57da0b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl index 3c8852be80..f28db4ad8a 100644 --- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_57da0b() { @@ -6,9 +10,10 @@ void textureDimensions_57da0b() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_57da0b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm index b61901170f..cec2ed3cfa 100644 --- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_57da0b "textureDimensions_57da0b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_57da0b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_57da0b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_57da0b + %30 = OpFunctionCall %void %textureDimensions_57da0b + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_57da0b +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_57da0b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_57da0b +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_57da0b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl index c28634f126..485e888267 100644 --- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_57da0b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_57da0b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl index 6b07538a11..e0f6c0181a 100644 --- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_57e7b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_57e7b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl index bf491cb4da..649a0744b1 100644 --- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_57e7b3() { @@ -6,9 +10,10 @@ void textureDimensions_57e7b3() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_57e7b3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm index 501de7b855..7e8fb3d3ae 100644 --- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_57e7b3 "textureDimensions_57e7b3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_57e7b3 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_57e7b3 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_57e7b3 + %30 = OpFunctionCall %void %textureDimensions_57e7b3 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_57e7b3 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_57e7b3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_57e7b3 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_57e7b3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl index 2de1c5de30..ef8e7a850c 100644 --- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_57e7b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_57e7b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl index abe400b86f..d5c72b4825 100644 --- a/test/intrinsics/gen/textureDimensions/58a515.wgsl +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_58a515() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_58a515(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl index dde543e56b..fd0bbea4f5 100644 --- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_58a515() { @@ -6,9 +10,10 @@ void textureDimensions_58a515() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_58a515(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm index c0f19b4135..85bea61af9 100644 --- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_58a515 "textureDimensions_58a515" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_58a515 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_58a515 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_58a515 + %32 = OpFunctionCall %void %textureDimensions_58a515 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_58a515 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_58a515 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_58a515 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_58a515 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl index c909b43341..238dcbac66 100644 --- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_58a515() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_58a515(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl index 2b877085f4..88623f3b3b 100644 --- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_5985f3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5985f3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl index 9bd1140ac9..c6847f1019 100644 --- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_5985f3() { @@ -6,9 +10,10 @@ void textureDimensions_5985f3() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_5985f3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm index fa73029fca..7f559e82b6 100644 --- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_5985f3 "textureDimensions_5985f3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_5985f3 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_5985f3 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_5985f3 + %32 = OpFunctionCall %void %textureDimensions_5985f3 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_5985f3 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_5985f3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_5985f3 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_5985f3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl index 28e8229f53..f8e2f8b2cc 100644 --- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_5985f3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5985f3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl index c907865ae5..edfe960a79 100644 --- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_5caa5e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5caa5e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl index d250720dd9..f4f6e3b084 100644 --- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_5caa5e() { @@ -6,9 +10,10 @@ void textureDimensions_5caa5e() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_5caa5e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm index 4890feec72..9d43ef9c8e 100644 --- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_5caa5e "textureDimensions_5caa5e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_5caa5e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_5caa5e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_5caa5e + %30 = OpFunctionCall %void %textureDimensions_5caa5e + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_5caa5e +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_5caa5e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_5caa5e +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_5caa5e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl index f1dfd35021..23e4b3601d 100644 --- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_5caa5e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5caa5e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl index be0e8ed7f7..2bc018d56e 100644 --- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_5e295d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5e295d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl index 3123bda5d5..e538f631a0 100644 --- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_5e295d() { @@ -6,9 +10,10 @@ void textureDimensions_5e295d() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_5e295d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm index bb02735845..c761434bf8 100644 --- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_5e295d "textureDimensions_5e295d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_5e295d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_5e295d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_5e295d + %33 = OpFunctionCall %void %textureDimensions_5e295d + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_5e295d +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_5e295d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_5e295d +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_5e295d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl index 493103b12e..a5193f0e1d 100644 --- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_5e295d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5e295d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl index 839f64a62f..7adf90efd6 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_5ec4e1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5ec4e1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl index 4aa8f3e862..5f11e270f5 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_5ec4e1() { @@ -6,9 +10,10 @@ void textureDimensions_5ec4e1() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_5ec4e1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm index 2e4dbd221c..354e77c2fa 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_5ec4e1 "textureDimensions_5ec4e1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %22 = OpConstantNull %v3int + %26 = OpConstantNull %v3int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_5ec4e1 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %22 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySizeLod %v2int %18 %int_1 - %13 = OpVectorShuffle %v3int %16 %16 0 1 1 - OpStore %res %13 +%textureDimensions_5ec4e1 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %26 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySizeLod %v2int %22 %int_1 + %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureDimensions_5ec4e1 + %34 = OpFunctionCall %void %textureDimensions_5ec4e1 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_5ec4e1 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_5ec4e1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureDimensions_5ec4e1 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureDimensions_5ec4e1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl index b0aa472241..e6ed80b13b 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_5ec4e1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_5ec4e1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl index 5a1f3c48aa..72fae60aac 100644 --- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_60bf54() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_60bf54(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl index 34334eec64..5038d47898 100644 --- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_60bf54() { @@ -6,9 +10,10 @@ void textureDimensions_60bf54() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_60bf54(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm index 89807598d5..fa2f41066b 100644 --- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_60bf54 "textureDimensions_60bf54" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_60bf54 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_60bf54 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_60bf54 + %30 = OpFunctionCall %void %textureDimensions_60bf54 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_60bf54 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_60bf54 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_60bf54 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_60bf54 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl index f2dd194188..54326c9bd7 100644 --- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_60bf54() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_60bf54(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl index 1a87d612e1..c0b0f26a7e 100644 --- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_63f3cf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_63f3cf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl index fcfed00657..a9de7f8bc3 100644 --- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_63f3cf() { @@ -6,9 +10,10 @@ void textureDimensions_63f3cf() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_63f3cf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm index 35ab54b738..a4f990007d 100644 --- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_63f3cf "textureDimensions_63f3cf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_63f3cf = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_63f3cf = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_63f3cf + %30 = OpFunctionCall %void %textureDimensions_63f3cf + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_63f3cf +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_63f3cf OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_63f3cf +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_63f3cf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl index b408be4f90..c77564fb18 100644 --- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_63f3cf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_63f3cf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl index 6fe34764d4..70bf9c2414 100644 --- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_66dc4e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_66dc4e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl index 0c86dc6493..476c3f6563 100644 --- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_66dc4e() { @@ -6,9 +10,10 @@ void textureDimensions_66dc4e() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_66dc4e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm index 63ab7f6d79..c47f34c90b 100644 --- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_66dc4e "textureDimensions_66dc4e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_66dc4e = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_66dc4e = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_66dc4e + %32 = OpFunctionCall %void %textureDimensions_66dc4e + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_66dc4e +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_66dc4e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_66dc4e +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_66dc4e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl index 35b621a640..8d5e3b57aa 100644 --- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_66dc4e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_66dc4e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl index 1893db1c76..a6bb16b302 100644 --- a/test/intrinsics/gen/textureDimensions/670d90.wgsl +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_670d90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_670d90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl index 8da3ae1776..0c7b7ce9cb 100644 --- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_670d90() { @@ -6,9 +10,10 @@ void textureDimensions_670d90() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_670d90(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm index 09d9df8006..acd52e6c3a 100644 --- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_670d90 "textureDimensions_670d90" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_670d90 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_670d90 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_670d90 + %30 = OpFunctionCall %void %textureDimensions_670d90 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_670d90 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_670d90 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_670d90 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_670d90 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl index 553906b742..3f6a780f39 100644 --- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_670d90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_670d90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl index 47040f31c9..ef0a866eba 100644 --- a/test/intrinsics/gen/textureDimensions/68105c.wgsl +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_68105c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_68105c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl index 01c571d1e9..47d45730ea 100644 --- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_68105c() { @@ -6,9 +10,10 @@ void textureDimensions_68105c() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_68105c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm index 2f3a80114d..3c80aded37 100644 --- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_68105c "textureDimensions_68105c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_68105c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_68105c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_68105c + %31 = OpFunctionCall %void %textureDimensions_68105c + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_68105c +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_68105c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_68105c +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_68105c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl index 979666edfd..dba95a2a36 100644 --- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_68105c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_68105c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl index 8ed6e68db4..55e1ef266c 100644 --- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_6adac6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6adac6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl index 8e90341d49..4e00737999 100644 --- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_6adac6() { @@ -6,9 +10,10 @@ void textureDimensions_6adac6() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_6adac6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm index 0030afdc85..322fa31bca 100644 --- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_6adac6 "textureDimensions_6adac6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_6adac6 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_6adac6 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_6adac6 + %29 = OpFunctionCall %void %textureDimensions_6adac6 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_6adac6 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_6adac6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_6adac6 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_6adac6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl index ef544c700d..2cf5d09108 100644 --- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_6adac6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6adac6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl index 6560c31078..ba0e1394ac 100644 --- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_6c08ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6c08ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl index a4b0f25dab..f8e730c17a 100644 --- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_6c08ab() { @@ -6,9 +10,10 @@ void textureDimensions_6c08ab() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_6c08ab(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm index 4f28d72278..9b6e76211f 100644 --- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_6c08ab "textureDimensions_6c08ab" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_6c08ab = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_6c08ab = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_6c08ab + %29 = OpFunctionCall %void %textureDimensions_6c08ab + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_6c08ab +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_6c08ab OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_6c08ab +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_6c08ab OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl index a43bd5dcf0..739dd84aef 100644 --- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_6c08ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6c08ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl index 5f143a0952..2ae6f7737b 100644 --- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_6e2d12() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6e2d12(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl index 68c8298397..9d87135d3f 100644 --- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_6e2d12() { @@ -6,9 +10,10 @@ void textureDimensions_6e2d12() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_6e2d12(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm index 3be8eef325..f2af0b5441 100644 --- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_6e2d12 "textureDimensions_6e2d12" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_6e2d12 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_6e2d12 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_6e2d12 + %29 = OpFunctionCall %void %textureDimensions_6e2d12 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_6e2d12 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_6e2d12 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_6e2d12 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_6e2d12 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl index c1496a75da..10b273b490 100644 --- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_6e2d12() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6e2d12(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl index a8f2f38305..0ddda4fd64 100644 --- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_6ec1b4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6ec1b4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl index f32020e70a..7bba9291ce 100644 --- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_6ec1b4() { @@ -6,9 +10,10 @@ void textureDimensions_6ec1b4() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_6ec1b4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm index 69bfc0076d..d9b8ac93e3 100644 --- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_6ec1b4 "textureDimensions_6ec1b4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_6ec1b4 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v3int %16 %int_0 - OpStore %res %13 +%textureDimensions_6ec1b4 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v3int %20 %int_0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_6ec1b4 + %32 = OpFunctionCall %void %textureDimensions_6ec1b4 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_6ec1b4 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_6ec1b4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_6ec1b4 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_6ec1b4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl index 543e010b04..e89a7d1859 100644 --- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_6ec1b4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6ec1b4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl index 81d1dd742c..59681b2b76 100644 --- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_6f0d79() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6f0d79(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl index f64072da2e..060565bf4f 100644 --- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_6f0d79() { @@ -6,9 +10,10 @@ void textureDimensions_6f0d79() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_6f0d79(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm index 207ca7b538..c82c664212 100644 --- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_6f0d79 "textureDimensions_6f0d79" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_6f0d79 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_6f0d79 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_6f0d79 + %32 = OpFunctionCall %void %textureDimensions_6f0d79 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_6f0d79 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_6f0d79 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_6f0d79 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_6f0d79 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl index 77931a9974..624277c0b0 100644 --- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_6f0d79() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_6f0d79(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl index ab009e8e7e..b0b6dbbfab 100644 --- a/test/intrinsics/gen/textureDimensions/702c53.wgsl +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_702c53() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_702c53(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl index 3900595213..c322459e64 100644 --- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_702c53() { @@ -6,9 +10,10 @@ void textureDimensions_702c53() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_702c53(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm index 2054bf8cbd..d1d44360f4 100644 --- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_702c53 "textureDimensions_702c53" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_702c53 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_702c53 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_702c53 + %30 = OpFunctionCall %void %textureDimensions_702c53 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_702c53 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_702c53 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_702c53 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_702c53 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl index 79bc870b24..c303a34112 100644 --- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_702c53() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_702c53(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl index c51357229f..ae6e85a865 100644 --- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_70e26a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_70e26a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl index 80e8478c1a..509cbe6228 100644 --- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_70e26a() { @@ -6,9 +10,10 @@ void textureDimensions_70e26a() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_70e26a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm index 93669b5d19..b72912352c 100644 --- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_70e26a "textureDimensions_70e26a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_70e26a = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_70e26a = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_70e26a + %30 = OpFunctionCall %void %textureDimensions_70e26a + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_70e26a +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_70e26a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_70e26a +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_70e26a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl index 5fa2f99b16..975437ab7b 100644 --- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_70e26a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_70e26a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl index 5c3f959135..bd1f976784 100644 --- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_71e8f7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_71e8f7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl index 27bb78a7f3..a1121b76f1 100644 --- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_71e8f7() { @@ -6,9 +10,10 @@ void textureDimensions_71e8f7() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_71e8f7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm index 659fd98b9a..5655892e00 100644 --- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_71e8f7 "textureDimensions_71e8f7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_71e8f7 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_71e8f7 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_71e8f7 + %31 = OpFunctionCall %void %textureDimensions_71e8f7 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_71e8f7 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_71e8f7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_71e8f7 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_71e8f7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl index a78950c7af..3380b0ee24 100644 --- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_71e8f7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_71e8f7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl index 33045e75ac..89e61d8b21 100644 --- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl +++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_72e5d6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_72e5d6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl index f7a5391098..85ff2aa276 100644 --- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_72e5d6() { @@ -6,9 +10,10 @@ void textureDimensions_72e5d6() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_72e5d6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm index 09ce4e7013..91db5ac9ba 100644 --- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_72e5d6 "textureDimensions_72e5d6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_72e5d6 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_1 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_72e5d6 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_1 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_72e5d6 + %33 = OpFunctionCall %void %textureDimensions_72e5d6 + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_72e5d6 +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_72e5d6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_72e5d6 +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_72e5d6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl index d81fb59af3..1a2db861d0 100644 --- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_72e5d6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_72e5d6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl index e3135e0a40..d524f81c31 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_75be9d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_75be9d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl index 4847eda7e7..4518519f4f 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_75be9d() { @@ -6,9 +10,10 @@ void textureDimensions_75be9d() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_75be9d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm index 85976e751b..b8bad8fa2d 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_75be9d "textureDimensions_75be9d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_75be9d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v2int %17 %int_1 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_75be9d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v2int %21 %int_1 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_75be9d + %33 = OpFunctionCall %void %textureDimensions_75be9d + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_75be9d +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_75be9d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_75be9d +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_75be9d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl index 65e0b26948..fa3ebce952 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_75be9d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_75be9d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl index 641a9225c3..3c1754b0a7 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl +++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_76e722() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_76e722(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl index f8e330d124..23371c9e9a 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_76e722() { @@ -6,9 +10,10 @@ void textureDimensions_76e722() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_76e722(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm index 2f5aadde03..153c14b8d5 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_76e722 "textureDimensions_76e722" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_76e722 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v2int %17 %int_0 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_76e722 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v2int %21 %int_0 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_76e722 + %33 = OpFunctionCall %void %textureDimensions_76e722 + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_76e722 +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_76e722 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_76e722 +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_76e722 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl index e69e66fe1c..3f69e91fdd 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_76e722() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_76e722(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl index bf9e0d9fb6..326eb5f466 100644 --- a/test/intrinsics/gen/textureDimensions/770103.wgsl +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_770103() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_770103(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl index 70cf96ca9a..69fdd9994e 100644 --- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_770103() { @@ -6,9 +10,10 @@ void textureDimensions_770103() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_770103(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm index 0847108a4f..2bce881951 100644 --- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_770103 "textureDimensions_770103" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_770103 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_770103 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_770103 + %30 = OpFunctionCall %void %textureDimensions_770103 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_770103 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_770103 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_770103 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_770103 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl index 9e79ca4244..b8ac441c39 100644 --- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_770103() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_770103(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl index 3b5d490e5f..468b838235 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_7bb707() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_7bb707(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl index 9c245c2676..ff67876f7a 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_7bb707() { @@ -6,9 +10,10 @@ void textureDimensions_7bb707() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_7bb707(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm index 993f04a398..d810420571 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_7bb707 "textureDimensions_7bb707" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %int Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_7bb707 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v2int %17 %int_1 - %13 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %13 +%textureDimensions_7bb707 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v2int %21 %int_1 + %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_7bb707 + %33 = OpFunctionCall %void %textureDimensions_7bb707 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_7bb707 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_7bb707 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_7bb707 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_7bb707 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl index 00428674ed..ed56d4e8ce 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_7bb707() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_7bb707(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl index d8c9051474..9d62d48b6d 100644 --- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl +++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_7bf826() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_7bf826(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl index 50ced2c2ed..cd4a7f5fb8 100644 --- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_7bf826() { @@ -6,9 +10,10 @@ void textureDimensions_7bf826() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_7bf826(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm index e898a264dc..f4e79cbaa0 100644 --- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_7bf826 "textureDimensions_7bf826" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_7bf826 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_0 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_7bf826 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_7bf826 + %33 = OpFunctionCall %void %textureDimensions_7bf826 + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_7bf826 +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_7bf826 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_7bf826 +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_7bf826 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl index 112470d241..ce97c6b5bb 100644 --- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_7bf826() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_7bf826(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl index 0f7628856c..6ddf46166b 100644 --- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_7f5c2e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_7f5c2e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl index a5c971c30f..e52ce55288 100644 --- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_7f5c2e() { @@ -6,9 +10,10 @@ void textureDimensions_7f5c2e() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_7f5c2e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm index ea3ec8cac6..b5079a3b3d 100644 --- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_7f5c2e "textureDimensions_7f5c2e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_7f5c2e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_7f5c2e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_7f5c2e + %30 = OpFunctionCall %void %textureDimensions_7f5c2e + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_7f5c2e +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_7f5c2e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_7f5c2e +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_7f5c2e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl index 3295f7812f..6fedeb1103 100644 --- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_7f5c2e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_7f5c2e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl index b6a6b4b813..c4ccf01b20 100644 --- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8028f3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8028f3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl index bd8d496c45..04a45e6482 100644 --- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_8028f3() { @@ -6,9 +10,10 @@ void textureDimensions_8028f3() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8028f3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm index 8eedc4b545..37cba25f47 100644 --- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8028f3 "textureDimensions_8028f3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8028f3 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_8028f3 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_8028f3 + %30 = OpFunctionCall %void %textureDimensions_8028f3 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_8028f3 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_8028f3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_8028f3 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_8028f3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl index 75cf9c5cab..a8552beb6e 100644 --- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8028f3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8028f3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl index 184ac8f9f0..f451436e8e 100644 --- a/test/intrinsics/gen/textureDimensions/811679.wgsl +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_811679() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_811679(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl index b01fc27e8f..566b02c98b 100644 --- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_811679() { @@ -6,9 +10,10 @@ void textureDimensions_811679() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_811679(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm index 235e2f97f9..0cd83819ef 100644 --- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_811679 "textureDimensions_811679" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_811679 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_811679 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_811679 + %31 = OpFunctionCall %void %textureDimensions_811679 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_811679 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_811679 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_811679 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_811679 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl index 20d46b42aa..3912edc0eb 100644 --- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_811679() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_811679(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl index e4fbff78ad..7b3229c8b0 100644 --- a/test/intrinsics/gen/textureDimensions/820596.wgsl +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_820596() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_820596(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl index 0130c6e1bd..82362a914c 100644 --- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_820596() { @@ -6,9 +10,10 @@ void textureDimensions_820596() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_820596(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm index cfa018e1c7..698abd1210 100644 --- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_820596 "textureDimensions_820596" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_820596 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_820596 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_820596 + %31 = OpFunctionCall %void %textureDimensions_820596 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_820596 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_820596 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_820596 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_820596 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl index 82ef750326..3372df2f1c 100644 --- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_820596() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_820596(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl index adc59d2184..240ff9a67b 100644 --- a/test/intrinsics/gen/textureDimensions/82138e.wgsl +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_82138e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_82138e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl index 2f824cf6e4..cd6085f900 100644 --- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_82138e() { @@ -6,9 +10,10 @@ void textureDimensions_82138e() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_82138e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm index 22715d59bf..5f80c2642b 100644 --- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_82138e "textureDimensions_82138e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_82138e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_82138e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_82138e + %31 = OpFunctionCall %void %textureDimensions_82138e + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_82138e +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_82138e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_82138e +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_82138e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl index 7e214451f3..7b8a30989f 100644 --- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_82138e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_82138e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl index 80ade64e15..ab9516f95c 100644 --- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8347ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8347ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl index eb82bb91c7..764a3bec77 100644 --- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_8347ab() { @@ -6,9 +10,10 @@ void textureDimensions_8347ab() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8347ab(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm index 63f5a4a014..307182ea83 100644 --- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8347ab "textureDimensions_8347ab" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8347ab = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_8347ab = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_8347ab + %29 = OpFunctionCall %void %textureDimensions_8347ab + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_8347ab +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_8347ab OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_8347ab +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_8347ab OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl index 2ad5bcbdb6..b87625cb05 100644 --- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8347ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8347ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl index b275c0bad5..cbd1466ca2 100644 --- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_83ee5a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_83ee5a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl index e4628b80e0..2d5bed0473 100644 --- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_83ee5a() { @@ -6,9 +10,10 @@ void textureDimensions_83ee5a() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_83ee5a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm index 46d81e1d82..818a993407 100644 --- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_83ee5a "textureDimensions_83ee5a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_83ee5a = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_83ee5a = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_83ee5a + %30 = OpFunctionCall %void %textureDimensions_83ee5a + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_83ee5a +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_83ee5a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_83ee5a +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_83ee5a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl index c65be39413..ac6d1245a4 100644 --- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_83ee5a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_83ee5a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl index d9e829bbd0..17c9db65cd 100644 --- a/test/intrinsics/gen/textureDimensions/85d556.wgsl +++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_85d556() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_85d556(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl index ce3a43c34e..e028f7ca3e 100644 --- a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_85d556() { @@ -6,9 +10,10 @@ void textureDimensions_85d556() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_85d556(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm index ed97d5a762..101c2587f4 100644 --- a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_85d556 "textureDimensions_85d556" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_85d556 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_1 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_85d556 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_1 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_85d556 + %33 = OpFunctionCall %void %textureDimensions_85d556 + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_85d556 +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_85d556 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_85d556 +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_85d556 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl index d0074ca4c1..673179fb17 100644 --- a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_85d556() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_85d556(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl index 72469f38c4..ab9e8244e4 100644 --- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8799ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8799ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl index 149cef78d4..ee449f04b8 100644 --- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_8799ee() { @@ -6,9 +10,10 @@ void textureDimensions_8799ee() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8799ee(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm index 5d3e426ac2..d00e641e33 100644 --- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8799ee "textureDimensions_8799ee" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8799ee = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_8799ee = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_8799ee + %30 = OpFunctionCall %void %textureDimensions_8799ee + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_8799ee +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_8799ee OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_8799ee +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_8799ee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl index 490113abd0..82f35a8790 100644 --- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8799ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8799ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl index 778784c237..5098dcf7e5 100644 --- a/test/intrinsics/gen/textureDimensions/89a864.wgsl +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_89a864() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_89a864(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl index 77eda67d36..1b6ca0aace 100644 --- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_89a864() { @@ -6,9 +10,10 @@ void textureDimensions_89a864() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_89a864(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm index 5d4534edcd..21c9a1f4e7 100644 --- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_89a864 "textureDimensions_89a864" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_89a864 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_89a864 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_89a864 + %30 = OpFunctionCall %void %textureDimensions_89a864 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_89a864 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_89a864 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_89a864 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_89a864 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl index d1c46bed0e..b8e4b8c846 100644 --- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_89a864() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_89a864(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl index ac87df5dd0..66f85c5e86 100644 --- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8aa4c4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8aa4c4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl index 609c45ddc1..de03454eaa 100644 --- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_8aa4c4() { @@ -6,9 +10,10 @@ void textureDimensions_8aa4c4() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8aa4c4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm index 232ff24713..109a999923 100644 --- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8aa4c4 "textureDimensions_8aa4c4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8aa4c4 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v3int %15 %int_0 - OpStore %res %12 +%textureDimensions_8aa4c4 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v3int %19 %int_0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_8aa4c4 + %31 = OpFunctionCall %void %textureDimensions_8aa4c4 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_8aa4c4 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_8aa4c4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_8aa4c4 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_8aa4c4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl index cbf79d1047..aefbeb250c 100644 --- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8aa4c4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8aa4c4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl index 7eb8bd5ed1..1d28464729 100644 --- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8b4fff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8b4fff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl index ac00230170..548895bf12 100644 --- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_8b4fff() { @@ -6,9 +10,10 @@ void textureDimensions_8b4fff() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8b4fff(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm index 6692c0f279..d8b143229c 100644 --- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8b4fff "textureDimensions_8b4fff" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8b4fff = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_8b4fff = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_8b4fff + %30 = OpFunctionCall %void %textureDimensions_8b4fff + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_8b4fff +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_8b4fff OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_8b4fff +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_8b4fff OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl index ee0d0f6967..5869ada308 100644 --- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8b4fff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8b4fff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl index e57c3b3de7..d50e163855 100644 --- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8d89f8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8d89f8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl index ac6eff30e7..b6af49c5bb 100644 --- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_8d89f8() { @@ -6,9 +10,10 @@ void textureDimensions_8d89f8() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8d89f8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm index 69e2f9e741..a8c50bcb3b 100644 --- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8d89f8 "textureDimensions_8d89f8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8d89f8 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_8d89f8 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_8d89f8 + %29 = OpFunctionCall %void %textureDimensions_8d89f8 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_8d89f8 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_8d89f8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_8d89f8 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_8d89f8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl index af689920e0..4e4b06ff0e 100644 --- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8d89f8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8d89f8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl index 6fdb2d4ccd..1d9ae227c0 100644 --- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8deb5e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8deb5e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl index c4107a45bd..fc59c20419 100644 --- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_8deb5e() { @@ -6,9 +10,10 @@ void textureDimensions_8deb5e() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8deb5e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm index d30a10486d..ca9d65b923 100644 --- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8deb5e "textureDimensions_8deb5e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8deb5e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v3int %15 %int_0 - OpStore %res %13 +%textureDimensions_8deb5e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v3int %19 %int_0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_8deb5e + %31 = OpFunctionCall %void %textureDimensions_8deb5e + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_8deb5e +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_8deb5e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_8deb5e +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_8deb5e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl index 49748656b8..8fdfbed2b7 100644 --- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8deb5e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8deb5e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl index bc6e1fa3bd..356552884b 100644 --- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_8fca0f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8fca0f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl index 821460797c..dbacbfdc2f 100644 --- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_8fca0f() { @@ -6,9 +10,10 @@ void textureDimensions_8fca0f() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_8fca0f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm index 8429e41f4f..3c2dc1f528 100644 --- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_8fca0f "textureDimensions_8fca0f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_8fca0f = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_8fca0f = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_8fca0f + %30 = OpFunctionCall %void %textureDimensions_8fca0f + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_8fca0f +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_8fca0f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_8fca0f +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_8fca0f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl index b901463cb6..bb7611f66d 100644 --- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_8fca0f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_8fca0f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl index 9c96fb84eb..251982f408 100644 --- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9042ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9042ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl index a3b30b6c55..282b6bcc65 100644 --- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_9042ab() { @@ -6,9 +10,10 @@ void textureDimensions_9042ab() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9042ab(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm index 62cae5671e..13fd167c6b 100644 --- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9042ab "textureDimensions_9042ab" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,36 +35,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9042ab = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_9042ab = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_9042ab + %33 = OpFunctionCall %void %textureDimensions_9042ab + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_9042ab +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_9042ab OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_9042ab +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_9042ab OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl index b7936eed31..e508ed0ad3 100644 --- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9042ab() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9042ab(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl index d0da65ccdb..87276b7313 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl +++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_91f42d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_91f42d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl index 507282e3f6..6466284b42 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_91f42d() { @@ -6,9 +10,10 @@ void textureDimensions_91f42d() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_91f42d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm index 02e408d8d4..d419675a9b 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_91f42d "textureDimensions_91f42d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_91f42d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %16 = OpImageQuerySizeLod %v3int %17 %int_1 - %13 = OpVectorShuffle %v3int %16 %16 0 1 1 - OpStore %res %13 +%textureDimensions_91f42d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %20 = OpImageQuerySizeLod %v3int %21 %int_1 + %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_91f42d + %33 = OpFunctionCall %void %textureDimensions_91f42d + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_91f42d +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_91f42d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_91f42d +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_91f42d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl index 2fbb19129c..a32641558b 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_91f42d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_91f42d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl index 8866e2d376..785db05fe0 100644 --- a/test/intrinsics/gen/textureDimensions/924742.wgsl +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_924742() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_924742(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl index 9485df78e9..d37de9d3f1 100644 --- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_924742() { @@ -6,9 +10,10 @@ void textureDimensions_924742() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_924742(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm index cd49cac1f9..5e4c2d2022 100644 --- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_924742 "textureDimensions_924742" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_924742 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_924742 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_924742 + %31 = OpFunctionCall %void %textureDimensions_924742 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_924742 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_924742 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_924742 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_924742 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl index f497afac19..0126b0ef57 100644 --- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_924742() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_924742(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl index c2f758f463..b3aa5eb3d9 100644 --- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_92ad20() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_92ad20(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl index 847c0c8b83..13de281cb8 100644 --- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_92ad20() { @@ -6,9 +10,10 @@ void textureDimensions_92ad20() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_92ad20(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm index 7bfccd3632..a60d51c15c 100644 --- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_92ad20 "textureDimensions_92ad20" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_92ad20 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_92ad20 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_92ad20 + %31 = OpFunctionCall %void %textureDimensions_92ad20 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_92ad20 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_92ad20 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_92ad20 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_92ad20 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl index f66e8a89ce..bb455ff211 100644 --- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_92ad20() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_92ad20(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl index 1c92cdec4d..37a80b1292 100644 --- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl +++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_939fdb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_939fdb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl index 66e508680e..38786a8d53 100644 --- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_939fdb() { @@ -6,9 +10,10 @@ void textureDimensions_939fdb() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_939fdb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm index a219560cf0..2c0fc5150a 100644 --- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_939fdb "textureDimensions_939fdb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_939fdb = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v2int %15 %int_0 - OpStore %res %12 +%textureDimensions_939fdb = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_939fdb + %31 = OpFunctionCall %void %textureDimensions_939fdb + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_939fdb +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_939fdb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_939fdb +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_939fdb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl index afb11dfd26..98e8e49d24 100644 --- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_939fdb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_939fdb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl index 17c6b566f6..a0450f515a 100644 --- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9572e5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9572e5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl index 3e53391581..0e529a0b3c 100644 --- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_9572e5() { @@ -6,9 +10,10 @@ void textureDimensions_9572e5() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9572e5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm index 6b65e7c281..bab24999a4 100644 --- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9572e5 "textureDimensions_9572e5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9572e5 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_9572e5 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_9572e5 + %30 = OpFunctionCall %void %textureDimensions_9572e5 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_9572e5 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_9572e5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_9572e5 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_9572e5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl index 2c7584813e..96d00a5074 100644 --- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9572e5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9572e5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl index 3fb8e60bbb..f862bb7a9c 100644 --- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_998f6b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_998f6b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl index 27f1091e2e..3d3813e59c 100644 --- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_998f6b() { @@ -6,9 +10,10 @@ void textureDimensions_998f6b() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_998f6b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm index 0a970f29c7..280d5dbda1 100644 --- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_998f6b "textureDimensions_998f6b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_998f6b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_998f6b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_998f6b + %33 = OpFunctionCall %void %textureDimensions_998f6b + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_998f6b +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_998f6b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_998f6b +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_998f6b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl index e299aa92b2..ab83144d23 100644 --- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_998f6b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_998f6b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl index 54066f9a91..f902ec5a72 100644 --- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9abfe5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9abfe5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl index 753587a10b..eafa206635 100644 --- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_9abfe5() { @@ -6,9 +10,10 @@ void textureDimensions_9abfe5() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9abfe5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm index 610275795f..1d99df49b7 100644 --- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9abfe5 "textureDimensions_9abfe5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9abfe5 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_9abfe5 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_9abfe5 + %32 = OpFunctionCall %void %textureDimensions_9abfe5 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_9abfe5 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_9abfe5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_9abfe5 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_9abfe5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl index 1d0b4d5a77..eaf4cb70f0 100644 --- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9abfe5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9abfe5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl index 6020ce438f..7a12b9765f 100644 --- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl +++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9c9c57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9c9c57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl index 18217fc007..2b71c0acba 100644 --- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_9c9c57() { @@ -6,9 +10,10 @@ void textureDimensions_9c9c57() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9c9c57(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm index c6b4449420..357711c050 100644 --- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9c9c57 "textureDimensions_9c9c57" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9c9c57 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_1 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_9c9c57 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_1 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_9c9c57 + %33 = OpFunctionCall %void %textureDimensions_9c9c57 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_9c9c57 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_9c9c57 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_9c9c57 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_9c9c57 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl index 20f18b75d9..57b235ba4c 100644 --- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9c9c57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9c9c57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl index 58f651544d..0a79b602b0 100644 --- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9da9e2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9da9e2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl index 3b3689ba5b..65426e4639 100644 --- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_9da9e2() { @@ -6,9 +10,10 @@ void textureDimensions_9da9e2() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9da9e2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm index e31891f813..6eb0177459 100644 --- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9da9e2 "textureDimensions_9da9e2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9da9e2 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_9da9e2 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_9da9e2 + %29 = OpFunctionCall %void %textureDimensions_9da9e2 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_9da9e2 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_9da9e2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_9da9e2 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_9da9e2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl index 042e71600a..a1c58b11db 100644 --- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9da9e2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9da9e2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl index 6a537c079b..6e01a2f25f 100644 --- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9eb8d8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9eb8d8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl index dcc6236ebd..48afe18c65 100644 --- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_9eb8d8() { @@ -6,9 +10,10 @@ void textureDimensions_9eb8d8() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9eb8d8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm index 3882431fe2..e4d6feabc7 100644 --- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9eb8d8 "textureDimensions_9eb8d8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9eb8d8 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_9eb8d8 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_9eb8d8 + %31 = OpFunctionCall %void %textureDimensions_9eb8d8 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_9eb8d8 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_9eb8d8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_9eb8d8 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_9eb8d8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl index 0d67656639..6e481c452f 100644 --- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9eb8d8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9eb8d8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl index 5688e42ae1..7dfdd7a80d 100644 --- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_9f8e46() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9f8e46(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl index 0e573aadb3..865eb303b8 100644 --- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_9f8e46() { @@ -6,9 +10,10 @@ void textureDimensions_9f8e46() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_9f8e46(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm index 0167c50c25..c102182df1 100644 --- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_9f8e46 "textureDimensions_9f8e46" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_9f8e46 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v2int %15 %int_0 - OpStore %res %12 +%textureDimensions_9f8e46 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_9f8e46 + %31 = OpFunctionCall %void %textureDimensions_9f8e46 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_9f8e46 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_9f8e46 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_9f8e46 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_9f8e46 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl index be69dc6d47..46dfdd4618 100644 --- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_9f8e46() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_9f8e46(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl index 52a8778859..1da9fbd6cd 100644 --- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_a0aad1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a0aad1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl index 02091582a1..03d4ed9a90 100644 --- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_a0aad1() { @@ -6,9 +10,10 @@ void textureDimensions_a0aad1() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_a0aad1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm index 20969b8afe..20f60aa25e 100644 --- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_a0aad1 "textureDimensions_a0aad1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_a0aad1 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_a0aad1 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_a0aad1 + %30 = OpFunctionCall %void %textureDimensions_a0aad1 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_a0aad1 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_a0aad1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_a0aad1 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_a0aad1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl index ecedf37f7c..2ea0a437e5 100644 --- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_a0aad1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a0aad1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl index 987701ca6b..aeef7e2c6c 100644 --- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_a0e4ec() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a0e4ec(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl index 8938df93b3..9e7545ba7c 100644 --- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_a0e4ec() { @@ -6,9 +10,10 @@ void textureDimensions_a0e4ec() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_a0e4ec(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm index aef6121883..c3bbdb2372 100644 --- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_a0e4ec "textureDimensions_a0e4ec" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_a0e4ec = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_a0e4ec = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_a0e4ec + %30 = OpFunctionCall %void %textureDimensions_a0e4ec + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_a0e4ec +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_a0e4ec OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_a0e4ec +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_a0e4ec OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl index fa2d645c3b..71446b5709 100644 --- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_a0e4ec() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a0e4ec(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl index 8509d5f3eb..e864dc446b 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl +++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_a6ca1c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a6ca1c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl index 3485629a8b..3f542dad15 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_a6ca1c() { @@ -6,9 +10,10 @@ void textureDimensions_a6ca1c() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_a6ca1c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm index e5d91598f3..93fb8240e4 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_a6ca1c "textureDimensions_a6ca1c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_a6ca1c = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v2int %17 %int_1 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_a6ca1c = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v2int %21 %int_1 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_a6ca1c + %33 = OpFunctionCall %void %textureDimensions_a6ca1c + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_a6ca1c +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_a6ca1c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_a6ca1c +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_a6ca1c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl index 2c6b2bcefe..1efb31a0a4 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_a6ca1c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a6ca1c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl index 94542d3548..e5ae723e85 100644 --- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_a7d565() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a7d565(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl index aa02095b96..025145a471 100644 --- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_a7d565() { @@ -6,9 +10,10 @@ void textureDimensions_a7d565() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_a7d565(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm index bf76e160af..a91bab2551 100644 --- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Sampled1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_a7d565 "textureDimensions_a7d565" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 1D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_a7d565 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %int %15 %int_0 - OpStore %res %13 +%textureDimensions_a7d565 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %int %19 %int_0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_a7d565 + %31 = OpFunctionCall %void %textureDimensions_a7d565 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_a7d565 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_a7d565 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_a7d565 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_a7d565 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl index 194c128e8b..4370c35b2f 100644 --- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_a7d565() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a7d565(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl index 104a9eeb14..dd6cfafabc 100644 --- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_a863f2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a863f2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl index 1cc4b99767..ebc454ccd4 100644 --- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_a863f2() { @@ -6,9 +10,10 @@ void textureDimensions_a863f2() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_a863f2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm index 3ec7cf7ed6..c1d9638d8c 100644 --- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_a863f2 "textureDimensions_a863f2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_a863f2 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_a863f2 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_a863f2 + %29 = OpFunctionCall %void %textureDimensions_a863f2 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_a863f2 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_a863f2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_a863f2 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_a863f2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl index cfb185490e..28907fe00a 100644 --- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_a863f2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_a863f2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl index 4b81975c03..4ce12afb5d 100644 --- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_ae457f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ae457f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl index 67ab5d154c..ca16cd7585 100644 --- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_ae457f() { @@ -6,9 +10,10 @@ void textureDimensions_ae457f() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_ae457f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm index d65d2703c3..0af7bbaa59 100644 --- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_ae457f "textureDimensions_ae457f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_ae457f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_ae457f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_ae457f + %33 = OpFunctionCall %void %textureDimensions_ae457f + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_ae457f +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_ae457f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_ae457f +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_ae457f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl index 7764208948..bc281cd77d 100644 --- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_ae457f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ae457f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl index 2f5db9e1d7..cd7079584d 100644 --- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_b0e16d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_b0e16d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl index 9f083d50c1..5e7a354607 100644 --- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_b0e16d() { @@ -6,9 +10,10 @@ void textureDimensions_b0e16d() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_b0e16d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm index 7c076e6e3f..dc421fd031 100644 --- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_b0e16d "textureDimensions_b0e16d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_b0e16d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v2int %15 %int_1 - OpStore %res %13 +%textureDimensions_b0e16d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v2int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_b0e16d + %31 = OpFunctionCall %void %textureDimensions_b0e16d + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_b0e16d +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_b0e16d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_b0e16d +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_b0e16d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl index 6908dfb044..e2b0d3b1eb 100644 --- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_b0e16d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_b0e16d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl index da39110a4c..dc537f644b 100644 --- a/test/intrinsics/gen/textureDimensions/b91240.wgsl +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_b91240() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_b91240(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl index 2b5ea2a16c..c5f0e3efbe 100644 --- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_b91240() { @@ -6,9 +10,10 @@ void textureDimensions_b91240() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_b91240(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm index 0ce5cc8c0c..fbc7759102 100644 --- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_b91240 "textureDimensions_b91240" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_b91240 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_b91240 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_b91240 + %30 = OpFunctionCall %void %textureDimensions_b91240 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_b91240 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_b91240 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_b91240 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_b91240 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl index 18cb6c5c35..73263d7371 100644 --- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_b91240() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_b91240(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl index 870a110637..c62607090a 100644 --- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl +++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_ba1481() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ba1481(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl index b54cbda80d..4fdd17235d 100644 --- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_ba1481() { @@ -6,9 +10,10 @@ void textureDimensions_ba1481() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_ba1481(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm index 66376a0c01..618d11bac8 100644 --- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_ba1481 "textureDimensions_ba1481" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_ba1481 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySizeLod %v2int %15 %int_0 - OpStore %res %12 +%textureDimensions_ba1481 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_ba1481 + %31 = OpFunctionCall %void %textureDimensions_ba1481 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_ba1481 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_ba1481 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_ba1481 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_ba1481 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl index 7fad75b7b3..30aa106564 100644 --- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_ba1481() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ba1481(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl index bb0be1d764..32d61407c4 100644 --- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_ba6e15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ba6e15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl index aee8136c88..3da4821530 100644 --- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_ba6e15() { @@ -6,9 +10,10 @@ void textureDimensions_ba6e15() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_ba6e15(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm index a49144e516..2e033df1d7 100644 --- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_ba6e15 "textureDimensions_ba6e15" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_ba6e15 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_ba6e15 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_ba6e15 + %30 = OpFunctionCall %void %textureDimensions_ba6e15 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_ba6e15 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_ba6e15 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_ba6e15 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_ba6e15 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl index a1bde09818..ef3d759332 100644 --- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_ba6e15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ba6e15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl index c16641c302..c0174c33ed 100644 --- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_bb3dde() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_bb3dde(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl index 456c682160..830d2b56f5 100644 --- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_bb3dde() { @@ -6,9 +10,10 @@ void textureDimensions_bb3dde() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_bb3dde(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm index e828d98cb3..55244663ba 100644 --- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_bb3dde "textureDimensions_bb3dde" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_bb3dde = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %15 - OpStore %res %13 +%textureDimensions_bb3dde = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_bb3dde + %30 = OpFunctionCall %void %textureDimensions_bb3dde + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_bb3dde +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_bb3dde OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_bb3dde +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_bb3dde OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl index e754d083b7..364b3b2c43 100644 --- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_bb3dde() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_bb3dde(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl index 824cc371b5..6f984cb4dc 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl +++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_bdf2ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_bdf2ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl index d30974776b..0864e716b0 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_bdf2ee() { @@ -6,9 +10,10 @@ void textureDimensions_bdf2ee() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_bdf2ee(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm index 95ab28977e..2f13378e67 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_bdf2ee "textureDimensions_bdf2ee" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_bdf2ee = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %16 %int_0 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_bdf2ee = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %20 %int_0 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_bdf2ee + %32 = OpFunctionCall %void %textureDimensions_bdf2ee + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_bdf2ee +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_bdf2ee OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_bdf2ee +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_bdf2ee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl index 97f89369d1..f16cd62e38 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_bdf2ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_bdf2ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl index 9a6a73195c..e634dbcc2a 100644 --- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_c2215f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c2215f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl index dcb01ec09e..a0bf314dac 100644 --- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_c2215f() { @@ -6,9 +10,10 @@ void textureDimensions_c2215f() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_c2215f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm index a4eb7112ff..52cc05fd0d 100644 --- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_c2215f "textureDimensions_c2215f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_c2215f = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_c2215f = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_c2215f + %32 = OpFunctionCall %void %textureDimensions_c2215f + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_c2215f +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_c2215f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_c2215f +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_c2215f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl index 183517557d..e2a273650d 100644 --- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_c2215f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c2215f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl index 3a270454dd..e03228c15f 100644 --- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_c30e75() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c30e75(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl index 2c32e82f71..187d499fa4 100644 --- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_c30e75() { @@ -6,9 +10,10 @@ void textureDimensions_c30e75() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_c30e75(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm index 8e8edd9971..6bfa57cca6 100644 --- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_c30e75 "textureDimensions_c30e75" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_c30e75 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_c30e75 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_c30e75 + %30 = OpFunctionCall %void %textureDimensions_c30e75 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_c30e75 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_c30e75 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_c30e75 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_c30e75 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl index 2419e830e0..aa7601854f 100644 --- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_c30e75() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c30e75(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl index 7e62f032b7..d8bff2a903 100644 --- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_c60b66() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c60b66(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl index 21925cc445..25d2b08aec 100644 --- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_c60b66() { @@ -6,9 +10,10 @@ void textureDimensions_c60b66() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_c60b66(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm index 339b5683ef..7f6cf257ea 100644 --- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_c60b66 "textureDimensions_c60b66" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,32 +35,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_c60b66 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_c60b66 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_c60b66 + %29 = OpFunctionCall %void %textureDimensions_c60b66 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_c60b66 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_c60b66 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_c60b66 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_c60b66 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl index 9825a31813..d0234350b6 100644 --- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_c60b66() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c60b66(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl index d6eb0a14cc..72535e49e5 100644 --- a/test/intrinsics/gen/textureDimensions/c74533.wgsl +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_c74533() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c74533(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl index bc9d1ef9a7..447186a33a 100644 --- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_c74533() { @@ -6,9 +10,10 @@ void textureDimensions_c74533() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_c74533(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm index d03a057fd6..433d41097c 100644 --- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_c74533 "textureDimensions_c74533" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_c74533 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_c74533 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_c74533 + %31 = OpFunctionCall %void %textureDimensions_c74533 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_c74533 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_c74533 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_c74533 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_c74533 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl index f232e4fb17..8acd040c6b 100644 --- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_c74533() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c74533(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl index cc6af895a8..80437236c4 100644 --- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_c7943d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c7943d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl index 3c904238b7..a5d7e287e2 100644 --- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_c7943d() { @@ -6,9 +10,10 @@ void textureDimensions_c7943d() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_c7943d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm index 7c935b0c02..15af643346 100644 --- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_c7943d "textureDimensions_c7943d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_c7943d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_c7943d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_c7943d + %31 = OpFunctionCall %void %textureDimensions_c7943d + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_c7943d +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_c7943d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_c7943d +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_c7943d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl index bcb79d86df..a78b4f4566 100644 --- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_c7943d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_c7943d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl index e563cf293d..23f494c114 100644 --- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_caaabb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_caaabb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl index 69e4489b38..fae0f87eee 100644 --- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_caaabb() { @@ -6,9 +10,10 @@ void textureDimensions_caaabb() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_caaabb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm index cb25aca237..c0faeb1870 100644 --- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_caaabb "textureDimensions_caaabb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,35 +35,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_caaabb = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_caaabb = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_caaabb + %32 = OpFunctionCall %void %textureDimensions_caaabb + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_caaabb +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_caaabb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_caaabb +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_caaabb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl index 90c1c289cb..1e79cdbe6e 100644 --- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_caaabb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_caaabb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl index ddf9b2c64c..72a7056a14 100644 --- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cc5478() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cc5478(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl index 0f9326ec51..2fbc2ad4ed 100644 --- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_cc5478() { @@ -6,9 +10,10 @@ void textureDimensions_cc5478() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cc5478(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm index 6bec852cb6..ab716b19e5 100644 --- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cc5478 "textureDimensions_cc5478" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cc5478 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_cc5478 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_cc5478 + %29 = OpFunctionCall %void %textureDimensions_cc5478 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_cc5478 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_cc5478 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_cc5478 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_cc5478 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl index baf34af8b2..94d868a8e0 100644 --- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cc5478() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cc5478(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl index 53edbe6584..811876dc12 100644 --- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cc968c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cc968c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl index 34104045d9..48cc885711 100644 --- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_cc968c() { @@ -6,9 +10,10 @@ void textureDimensions_cc968c() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cc968c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm index a1322ae479..ce06dbb0e2 100644 --- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm @@ -1,22 +1,25 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cc968c "textureDimensions_cc968c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -32,32 +36,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cc968c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_cc968c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_cc968c + %29 = OpFunctionCall %void %textureDimensions_cc968c + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_cc968c +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_cc968c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_cc968c +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_cc968c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl index fa5b5b21bf..0535708d9a 100644 --- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cc968c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cc968c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl index 4a950210cd..12dda6d054 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cccc17() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cccc17(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl index 743516c916..468f704bbc 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_cccc17() { @@ -6,9 +10,10 @@ void textureDimensions_cccc17() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cccc17(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm index 4d67eeb428..b72547154a 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cccc17 "textureDimensions_cccc17" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %int Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cccc17 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v2int %17 %int_0 - %13 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %13 +%textureDimensions_cccc17 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v2int %21 %int_0 + %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_cccc17 + %33 = OpFunctionCall %void %textureDimensions_cccc17 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_cccc17 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_cccc17 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_cccc17 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_cccc17 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl index 7b1d7bd718..36fc6c1b66 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cccc17() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cccc17(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl index 663339fea6..aad493d5ff 100644 --- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cccc8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cccc8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl index 0888f24a8b..2971b4b678 100644 --- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_cccc8f() { @@ -6,9 +10,10 @@ void textureDimensions_cccc8f() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cccc8f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm index ffb7c509b9..c12ca5c5f8 100644 --- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cccc8f "textureDimensions_cccc8f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cccc8f = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_cccc8f = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_cccc8f + %29 = OpFunctionCall %void %textureDimensions_cccc8f + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_cccc8f +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_cccc8f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_cccc8f +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_cccc8f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl index a7b4ce0162..84b8ce7bb2 100644 --- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cccc8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cccc8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl index 5025753c95..9025bb5f91 100644 --- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cd76a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cd76a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl index babcfe114b..f616593a99 100644 --- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_cd76a7() { @@ -6,9 +10,10 @@ void textureDimensions_cd76a7() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cd76a7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm index b1b8e4953b..546e8a1b26 100644 --- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cd76a7 "textureDimensions_cd76a7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cd76a7 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_cd76a7 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_cd76a7 + %30 = OpFunctionCall %void %textureDimensions_cd76a7 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_cd76a7 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_cd76a7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_cd76a7 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_cd76a7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl index ff0d168b0d..808c1ae439 100644 --- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cd76a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cd76a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl index 2383f87c63..6a15587827 100644 --- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cdaff9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cdaff9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl index c7fba3fb37..95cb20bf23 100644 --- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_cdaff9() { @@ -6,9 +10,10 @@ void textureDimensions_cdaff9() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cdaff9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm index ca690e7e7b..0b9efd8a1d 100644 --- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cdaff9 "textureDimensions_cdaff9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cdaff9 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_cdaff9 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_cdaff9 + %30 = OpFunctionCall %void %textureDimensions_cdaff9 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_cdaff9 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_cdaff9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_cdaff9 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_cdaff9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl index f69c2b560a..2f6b64c55c 100644 --- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cdaff9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cdaff9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl index 9a18a7d8af..0c2d7b49a2 100644 --- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cdf473() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cdf473(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl index 0c847dbcc4..1f10d1827a 100644 --- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_cdf473() { @@ -6,9 +10,10 @@ void textureDimensions_cdf473() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cdf473(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm index 674d1c4808..946919e3a2 100644 --- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cdf473 "textureDimensions_cdf473" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cdf473 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_cdf473 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_cdf473 + %32 = OpFunctionCall %void %textureDimensions_cdf473 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_cdf473 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_cdf473 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_cdf473 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_cdf473 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl index 9f0229809c..f25baa9a77 100644 --- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cdf473() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cdf473(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl index f341fe2cb4..d8d4e1f5ce 100644 --- a/test/intrinsics/gen/textureDimensions/cec841.wgsl +++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cec841() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cec841(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl index 44fed34b92..e99586d5ef 100644 --- a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_cec841() { @@ -6,9 +10,10 @@ void textureDimensions_cec841() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cec841(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm index caa966a6e4..419ce59c7a 100644 --- a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cec841 "textureDimensions_cec841" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cec841 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_0 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_cec841 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_cec841 + %33 = OpFunctionCall %void %textureDimensions_cec841 + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_cec841 +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_cec841 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_cec841 +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_cec841 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl index fa1ee137a3..902e7c793f 100644 --- a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cec841() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cec841(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl index a06115f817..6315cb005f 100644 --- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cf1d42() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cf1d42(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl index 06a13675fc..49a3eb8918 100644 --- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_cf1d42() { @@ -6,9 +10,10 @@ void textureDimensions_cf1d42() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cf1d42(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm index 03d962dc43..b9e6602257 100644 --- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cf1d42 "textureDimensions_cf1d42" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cf1d42 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_cf1d42 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_cf1d42 + %29 = OpFunctionCall %void %textureDimensions_cf1d42 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_cf1d42 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_cf1d42 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_cf1d42 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_cf1d42 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl index bdae356549..4a3610d6be 100644 --- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cf1d42() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cf1d42(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl index 30cf75926b..05036fa85e 100644 --- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_cf7e43() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cf7e43(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl index b2e6947d7f..1cba320935 100644 --- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_cf7e43() { @@ -6,9 +10,10 @@ void textureDimensions_cf7e43() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_cf7e43(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm index b268aaeb24..f4aec525d4 100644 --- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_cf7e43 "textureDimensions_cf7e43" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cf7e43 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v3int %15 - OpStore %res %12 +%textureDimensions_cf7e43 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v3int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_cf7e43 + %30 = OpFunctionCall %void %textureDimensions_cf7e43 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_cf7e43 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_cf7e43 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_cf7e43 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_cf7e43 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl index ccdd94f9dc..db7d5887bd 100644 --- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_cf7e43() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_cf7e43(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl index 2387895aa2..6e765021b0 100644 --- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_d40b9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_d40b9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl index 2943bb5447..2dd0690cb3 100644 --- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_d40b9e() { @@ -6,9 +10,10 @@ void textureDimensions_d40b9e() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_d40b9e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm index 9408183653..05a43cf4ff 100644 --- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_d40b9e "textureDimensions_d40b9e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_d40b9e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_d40b9e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_d40b9e + %30 = OpFunctionCall %void %textureDimensions_d40b9e + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_d40b9e +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_d40b9e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_d40b9e +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_d40b9e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl index 83398fb401..a3480eebd3 100644 --- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_d40b9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_d40b9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl index fee84c37e7..80a4a426e6 100644 --- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_d4106f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_d4106f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl index c38086ee47..630ecd74ec 100644 --- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_d4106f() { @@ -6,9 +10,10 @@ void textureDimensions_d4106f() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_d4106f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm index 5ab2c0b361..642a64a0ee 100644 --- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_d4106f "textureDimensions_d4106f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_d4106f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_d4106f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_d4106f + %30 = OpFunctionCall %void %textureDimensions_d4106f + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_d4106f +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_d4106f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_d4106f +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_d4106f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl index fd06290da6..3dd74734fb 100644 --- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_d4106f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_d4106f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl index dc9570ab0c..8b6d2ccc2a 100644 --- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_d8f951() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_d8f951(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl index 819ca59af7..bd74f950a4 100644 --- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_d8f951() { @@ -6,9 +10,10 @@ void textureDimensions_d8f951() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_d8f951(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm index 16cdf49991..11b7e33a70 100644 --- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_d8f951 "textureDimensions_d8f951" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_d8f951 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %int %14 - OpStore %res %12 +%textureDimensions_d8f951 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_d8f951 + %29 = OpFunctionCall %void %textureDimensions_d8f951 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_d8f951 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_d8f951 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_d8f951 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_d8f951 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl index c41b14d7f5..b807203be4 100644 --- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_d8f951() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_d8f951(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl index 5df347c42f..a44128f87f 100644 --- a/test/intrinsics/gen/textureDimensions/da3099.wgsl +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_da3099() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_da3099(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl index c474ad5ad8..e927c7bfb4 100644 --- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_da3099() { @@ -6,9 +10,10 @@ void textureDimensions_da3099() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_da3099(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm index bf8331ecc1..3930ab3d6a 100644 --- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_da3099 "textureDimensions_da3099" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_da3099 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_da3099 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_da3099 + %31 = OpFunctionCall %void %textureDimensions_da3099 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_da3099 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_da3099 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_da3099 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_da3099 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl index cd9fdad396..738261e913 100644 --- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_da3099() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_da3099(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl index 35942795ec..bcc764720c 100644 --- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl +++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_daf7c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_daf7c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl index df5ba6fc67..9f629015c2 100644 --- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureDimensions_daf7c0() { @@ -6,9 +10,10 @@ void textureDimensions_daf7c0() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_daf7c0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm index 3f0b9f7686..b766be7eca 100644 --- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_daf7c0 "textureDimensions_daf7c0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %int 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_daf7c0 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %15 - OpStore %res %13 +%textureDimensions_daf7c0 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_daf7c0 + %30 = OpFunctionCall %void %textureDimensions_daf7c0 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_daf7c0 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_daf7c0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_daf7c0 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_daf7c0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl index 181c2f0367..769f80ec78 100644 --- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_daf7c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_daf7c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl index fe52a14aef..288017048c 100644 --- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_dba47c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_dba47c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl index 297cde7e06..18b7207da7 100644 --- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_dba47c() { @@ -6,9 +10,10 @@ void textureDimensions_dba47c() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_dba47c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm index 54b70a501e..ef594fb06c 100644 --- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_dba47c "textureDimensions_dba47c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_dba47c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_dba47c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_dba47c + %30 = OpFunctionCall %void %textureDimensions_dba47c + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_dba47c +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_dba47c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_dba47c +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_dba47c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl index f702afb979..e8ad8b5401 100644 --- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_dba47c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_dba47c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl index 4e72a1457b..c8d7ed9517 100644 --- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_dc2dd0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_dc2dd0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl index a5f39b185b..b85d0a449b 100644 --- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureDimensions_dc2dd0() { @@ -6,9 +10,10 @@ void textureDimensions_dc2dd0() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_dc2dd0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm index fee701f41b..9c1d4c472c 100644 --- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_dc2dd0 "textureDimensions_dc2dd0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,33 +35,45 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_dc2dd0 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %15 - OpStore %res %13 +%textureDimensions_dc2dd0 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_dc2dd0 + %30 = OpFunctionCall %void %textureDimensions_dc2dd0 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_dc2dd0 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_dc2dd0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_dc2dd0 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_dc2dd0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl index 03c58ba7f2..cbfe2d925e 100644 --- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_dc2dd0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_dc2dd0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl index abe6f69ace..a9463ad30c 100644 --- a/test/intrinsics/gen/textureDimensions/e10157.wgsl +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e10157() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e10157(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl index 46f2239de6..ba150337b8 100644 --- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_e10157() { @@ -6,9 +10,10 @@ void textureDimensions_e10157() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e10157(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm index 333a4c1c0d..f66239237c 100644 --- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e10157 "textureDimensions_e10157" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e10157 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_e10157 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_e10157 + %31 = OpFunctionCall %void %textureDimensions_e10157 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_e10157 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_e10157 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_e10157 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_e10157 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl index 4d62897f06..cea3ee548e 100644 --- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e10157() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e10157(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl index 9f27264257..8eaa52aea7 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl +++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e22247() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e22247(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl index d62e4c4b59..b8173a6a1e 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_e22247() { @@ -6,9 +10,10 @@ void textureDimensions_e22247() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e22247(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm index 818d5e763e..26499875fd 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e22247 "textureDimensions_e22247" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e22247 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %16 %int_1 - %13 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %13 +%textureDimensions_e22247 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %20 %int_1 + %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_e22247 + %32 = OpFunctionCall %void %textureDimensions_e22247 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_e22247 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_e22247 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_e22247 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_e22247 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl index 520a4c426e..7e079edc50 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e22247() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e22247(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl index fe88bb99ad..20cf789094 100644 --- a/test/intrinsics/gen/textureDimensions/e93464.wgsl +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e93464() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e93464(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl index 77def20415..ce99f9c2a8 100644 --- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureDimensions_e93464() { @@ -6,9 +10,10 @@ void textureDimensions_e93464() { int res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e93464(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm index c6da4fffa1..8a868849de 100644 --- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm @@ -1,22 +1,25 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e93464 "textureDimensions_e93464" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -32,32 +36,44 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e93464 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %int %14 - OpStore %res %13 +%textureDimensions_e93464 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureDimensions_e93464 + %29 = OpFunctionCall %void %textureDimensions_e93464 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureDimensions_e93464 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureDimensions_e93464 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_e93464 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_e93464 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl index f017f43a2a..57ba70605e 100644 --- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e93464() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e93464(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl index 2ad145c006..8072e78db0 100644 --- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e9628c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9628c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl index 5272b2dd7b..ffafc1fdec 100644 --- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_e9628c() { @@ -6,9 +10,10 @@ void textureDimensions_e9628c() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e9628c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm index 64d21e6b7f..75e4e59886 100644 --- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e9628c "textureDimensions_e9628c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e9628c = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_e9628c = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_e9628c + %32 = OpFunctionCall %void %textureDimensions_e9628c + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_e9628c +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_e9628c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_e9628c +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_e9628c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl index 25127fe05d..f159ee130b 100644 --- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e9628c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9628c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl index 0237b9f5a8..a34bc49f2d 100644 --- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e9e96c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9e96c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl index efb7f4d6ab..b2c594ba81 100644 --- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_e9e96c() { @@ -6,9 +10,10 @@ void textureDimensions_e9e96c() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e9e96c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm index 03ca8d599b..959f5e1ede 100644 --- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e9e96c "textureDimensions_e9e96c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e9e96c = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_e9e96c = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_e9e96c + %32 = OpFunctionCall %void %textureDimensions_e9e96c + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_e9e96c +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_e9e96c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_e9e96c +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_e9e96c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl index 7cafbf8672..80b69f69a7 100644 --- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e9e96c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9e96c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl index c9413c21e0..e12e6c9b83 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e9fe54() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9fe54(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl index c6793f2bdc..562ae94711 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_e9fe54() { @@ -6,9 +10,10 @@ void textureDimensions_e9fe54() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e9fe54(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm index c9c5d5b612..469d0ddf4e 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e9fe54 "textureDimensions_e9fe54" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e9fe54 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v2int %16 - OpStore %res %13 +%textureDimensions_e9fe54 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v2int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_e9fe54 + %31 = OpFunctionCall %void %textureDimensions_e9fe54 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_e9fe54 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_e9fe54 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_e9fe54 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_e9fe54 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl index cd6f322e0c..c5a4c06a80 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e9fe54() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9fe54(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl index 92d0fa1717..8ad365a2ec 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_e9fe58() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9fe58(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl index 3a61c1eccb..ff7df2f405 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_e9fe58() { @@ -6,9 +10,10 @@ void textureDimensions_e9fe58() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_e9fe58(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm index da7d41f0cc..6058fa6831 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_e9fe58 "textureDimensions_e9fe58" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e9fe58 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_e9fe58 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_e9fe58 + %33 = OpFunctionCall %void %textureDimensions_e9fe58 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_e9fe58 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_e9fe58 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_e9fe58 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_e9fe58 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl index 7b8176763a..f6d3e7eeac 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_e9fe58() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_e9fe58(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl index 8e328a876f..91a4c17a08 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl +++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_eda4e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_eda4e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl index 6034d6ec9b..50bf52594a 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_eda4e3() { @@ -6,9 +10,10 @@ void textureDimensions_eda4e3() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_eda4e3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm index 83a4af6a8e..694581ba40 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_eda4e3 "textureDimensions_eda4e3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_eda4e3 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %16 %int_1 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_eda4e3 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %20 %int_1 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_eda4e3 + %32 = OpFunctionCall %void %textureDimensions_eda4e3 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_eda4e3 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_eda4e3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_eda4e3 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_eda4e3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl index 148c5de9e9..64770e4206 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_eda4e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_eda4e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl index 3273bca9c4..e3cd45b2fd 100644 --- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl +++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_ef5b89() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ef5b89(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl index e7ff8585a4..cc597c8062 100644 --- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureDimensions_ef5b89() { @@ -6,9 +10,10 @@ void textureDimensions_ef5b89() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_ef5b89(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm index dbe51815e6..7a808a9d40 100644 --- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_ef5b89 "textureDimensions_ef5b89" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,34 +32,46 @@ %7 = OpTypeImage %float 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_ef5b89 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_ef5b89 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_ef5b89 + %30 = OpFunctionCall %void %textureDimensions_ef5b89 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_ef5b89 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_ef5b89 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_ef5b89 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_ef5b89 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl index dc089a7b62..f22145a049 100644 --- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_ef5b89() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_ef5b89(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl index f0c45632c1..b8518f9c53 100644 --- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_efc8a4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_efc8a4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl index ed94895f9d..a461b2c132 100644 --- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_efc8a4() { @@ -6,9 +10,10 @@ void textureDimensions_efc8a4() { int3 res = tint_tmp.xyz; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_efc8a4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm index 4c2a8d3e83..c4abad8dd7 100644 --- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_efc8a4 "textureDimensions_efc8a4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_efc8a4 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v3int %15 %int_1 - OpStore %res %13 +%textureDimensions_efc8a4 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v3int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_efc8a4 + %31 = OpFunctionCall %void %textureDimensions_efc8a4 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_efc8a4 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_efc8a4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_efc8a4 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_efc8a4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl index 88c7e1ea22..ac65d8039b 100644 --- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_efc8a4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_efc8a4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl index bda8cbcc21..7ff1484e89 100644 --- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f1b72b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f1b72b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl index 5d979049f8..618544b77e 100644 --- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_f1b72b() { @@ -6,9 +10,10 @@ void textureDimensions_f1b72b() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f1b72b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm index a17cf540b2..1d87771192 100644 --- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f1b72b "textureDimensions_f1b72b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f1b72b = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_f1b72b = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_f1b72b + %30 = OpFunctionCall %void %textureDimensions_f1b72b + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_f1b72b +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_f1b72b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_f1b72b +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_f1b72b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl index e74dca43bc..7b8c55cd0a 100644 --- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f1b72b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f1b72b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl index 99025ba454..407c7b6b56 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f507c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f507c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl index e083f66bdc..df608e505e 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureDimensions_f507c9() { @@ -6,9 +10,10 @@ void textureDimensions_f507c9() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f507c9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm index 4827f1ac9c..4e489d1f8d 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f507c9 "textureDimensions_f507c9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %21 = OpConstantNull %v3int + %25 = OpConstantNull %v3int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f507c9 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v2int %17 %int_0 - %12 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %12 +%textureDimensions_f507c9 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v2int %21 %int_0 + %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_f507c9 + %33 = OpFunctionCall %void %textureDimensions_f507c9 + %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_f507c9 +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_f507c9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_f507c9 +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_f507c9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl index 98211b780b..5f62f50d2b 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f507c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f507c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl index fe667e8f52..424adf0d99 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl +++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f70326() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f70326(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl index 01c94f254b..2a2bd88e09 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureDimensions_f70326() { @@ -6,9 +10,10 @@ void textureDimensions_f70326() { int3 res = tint_tmp.xyy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f70326(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm index 70a5677ef7..f1a58b41d3 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f70326 "textureDimensions_f70326" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_v3int = OpTypePointer Function %v3int - %20 = OpConstantNull %v3int + %24 = OpConstantNull %v3int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f70326 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %20 - %16 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %16 %int_0 - %13 = OpVectorShuffle %v3int %15 %15 0 1 1 - OpStore %res %13 +%textureDimensions_f70326 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %24 + %20 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %20 %int_0 + %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_f70326 + %32 = OpFunctionCall %void %textureDimensions_f70326 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_f70326 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_f70326 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_f70326 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_f70326 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl index e1de80d71c..6209bb22c2 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f70326() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f70326(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl index 908ea166a5..935495fc05 100644 --- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f7145b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f7145b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl index 5b964ae2a0..3d134196b7 100644 --- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_f7145b() { @@ -6,9 +10,10 @@ void textureDimensions_f7145b() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f7145b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm index a4849426a6..fe170458c1 100644 --- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f7145b "textureDimensions_f7145b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f7145b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v2int %16 %int_1 - OpStore %res %13 +%textureDimensions_f7145b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v2int %20 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_f7145b + %32 = OpFunctionCall %void %textureDimensions_f7145b + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_f7145b +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_f7145b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_f7145b +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_f7145b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl index 6da99032bd..9b443d8a9c 100644 --- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f7145b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f7145b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl index b1fc576d85..22a9796cc3 100644 --- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f7aa9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f7aa9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl index 23a9a6cd9a..3f905856a3 100644 --- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_f7aa9e() { @@ -6,9 +10,10 @@ void textureDimensions_f7aa9e() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f7aa9e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm index 8e629d6242..19ff5117cf 100644 --- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f7aa9e "textureDimensions_f7aa9e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f7aa9e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %13 +%textureDimensions_f7aa9e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_f7aa9e + %32 = OpFunctionCall %void %textureDimensions_f7aa9e + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_f7aa9e +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_f7aa9e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_f7aa9e +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_f7aa9e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl index 8f5107004a..2fa399fcba 100644 --- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f7aa9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f7aa9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl index 3aafa81294..849048103b 100644 --- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f7e436() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f7e436(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl index 49ca1c1f13..0d1a0f336c 100644 --- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureDimensions_f7e436() { @@ -6,9 +10,10 @@ void textureDimensions_f7e436() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f7e436(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm index 75f7e65c51..e6cc284a2a 100644 --- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f7e436 "textureDimensions_f7e436" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %21 = OpConstantNull %v2int + %25 = OpConstantNull %v2int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f7e436 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %21 - %18 = OpLoad %7 %arg_0 - %16 = OpImageQuerySize %v3int %18 - %13 = OpVectorShuffle %v2int %16 %16 0 1 - OpStore %res %13 +%textureDimensions_f7e436 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %25 + %22 = OpLoad %7 %arg_0 + %20 = OpImageQuerySize %v3int %22 + %17 = OpVectorShuffle %v2int %20 %20 0 1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureDimensions_f7e436 + %33 = OpFunctionCall %void %textureDimensions_f7e436 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_f7e436 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_f7e436 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureDimensions_f7e436 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureDimensions_f7e436 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl index 5b003c54a4..0b0ef269d9 100644 --- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f7e436() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f7e436(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl index a434674092..d684e54332 100644 --- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_f931c7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f931c7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl index 611e994b0b..2cef0e7a3f 100644 --- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureDimensions_f931c7() { @@ -6,9 +10,10 @@ void textureDimensions_f931c7() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_f931c7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm index 726ba5b87a..e1e3209fad 100644 --- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_f931c7 "textureDimensions_f931c7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f931c7 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_f931c7 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_f931c7 + %30 = OpFunctionCall %void %textureDimensions_f931c7 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_f931c7 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_f931c7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_f931c7 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_f931c7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl index 4253c30ec1..0d82fc1de4 100644 --- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_f931c7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_f931c7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl index bfe7139b40..7d6e1a4787 100644 --- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_fa90e1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fa90e1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl index f5f998f07f..d91cb26b06 100644 --- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_fa90e1() { @@ -6,9 +10,10 @@ void textureDimensions_fa90e1() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_fa90e1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm index e52ec7d5c2..c997daa474 100644 --- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_fa90e1 "textureDimensions_fa90e1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %_ptr_Function_v2int = OpTypePointer Function %v2int - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_fa90e1 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %18 - %15 = OpLoad %7 %arg_0 - %12 = OpImageQuerySize %v2int %15 - OpStore %res %12 +%textureDimensions_fa90e1 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %22 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySize %v2int %19 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureDimensions_fa90e1 + %30 = OpFunctionCall %void %textureDimensions_fa90e1 + %31 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %24 = OpLabel - %25 = OpFunctionCall %void %textureDimensions_fa90e1 +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureDimensions_fa90e1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureDimensions_fa90e1 +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureDimensions_fa90e1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl index 546939fae0..e7a2306723 100644 --- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_fa90e1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fa90e1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl index 25ce8976ee..d0b6130730 100644 --- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_fa9859() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fa9859(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl index 9808fe7e02..032a8569aa 100644 --- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureDimensions_fa9859() { @@ -6,9 +10,10 @@ void textureDimensions_fa9859() { int2 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_fa9859(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm index 3d933f0c3e..231e68aa92 100644 --- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_fa9859 "textureDimensions_fa9859" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 %_ptr_Function_v2int = OpTypePointer Function %v2int - %19 = OpConstantNull %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_fa9859 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySizeLod %v2int %15 %int_0 - OpStore %res %13 +%textureDimensions_fa9859 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v2int %19 %int_0 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_fa9859 + %31 = OpFunctionCall %void %textureDimensions_fa9859 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_fa9859 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_fa9859 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_fa9859 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_fa9859 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl index dab65210b1..eec24471ed 100644 --- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_fa9859() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fa9859(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl index 3567a74715..4461338a91 100644 --- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_fb5670() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fb5670(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl index f7495262ad..371a86ff47 100644 --- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureDimensions_fb5670() { @@ -6,9 +10,10 @@ void textureDimensions_fb5670() { int2 res = tint_tmp.xy; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_fb5670(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm index 3cb08940e2..79530cbb2d 100644 --- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_fb5670 "textureDimensions_fb5670" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %_ptr_Function_v2int = OpTypePointer Function %v2int - %20 = OpConstantNull %v2int + %24 = OpConstantNull %v2int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_fb5670 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v2int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %12 = OpVectorShuffle %v2int %15 %15 0 1 - OpStore %res %12 +%textureDimensions_fb5670 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %16 = OpVectorShuffle %v2int %19 %19 0 1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureDimensions_fb5670 + %32 = OpFunctionCall %void %textureDimensions_fb5670 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureDimensions_fb5670 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureDimensions_fb5670 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureDimensions_fb5670 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureDimensions_fb5670 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl index fc9f484b6d..9e57cf6a8b 100644 --- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_fb5670() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fb5670(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl index ce6e8f901e..24175a2d32 100644 --- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_fbbe4d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fbbe4d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl index 227e90d957..e65ba3ea8c 100644 --- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureDimensions_fbbe4d() { @@ -6,9 +10,10 @@ void textureDimensions_fbbe4d() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_fbbe4d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm index cb79facfdb..6333e2cffb 100644 --- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_fbbe4d "textureDimensions_fbbe4d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_fbbe4d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_fbbe4d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_fbbe4d + %31 = OpFunctionCall %void %textureDimensions_fbbe4d + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_fbbe4d +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_fbbe4d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_fbbe4d +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_fbbe4d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl index 1b311d4a7f..724fec4150 100644 --- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_fbbe4d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fbbe4d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl index f8ce06e2e9..89ee977067 100644 --- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl @@ -28,8 +28,9 @@ fn textureDimensions_fcac78() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fcac78(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl index 97f637eef4..e4f8e2dc75 100644 --- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureDimensions_fcac78() { @@ -6,9 +10,10 @@ void textureDimensions_fcac78() { int3 res = tint_tmp; } -void vertex_main() { +tint_symbol vertex_main() { textureDimensions_fcac78(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm index bdb36a804f..bc049db8e7 100644 --- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureDimensions_fcac78 "textureDimensions_fcac78" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_v3int = OpTypePointer Function %v3int - %19 = OpConstantNull %v3int + %23 = OpConstantNull %v3int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_fcac78 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %19 - %16 = OpLoad %7 %arg_0 - %13 = OpImageQuerySize %v3int %16 - OpStore %res %13 +%textureDimensions_fcac78 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %23 + %20 = OpLoad %7 %arg_0 + %17 = OpImageQuerySize %v3int %20 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureDimensions_fcac78 + %31 = OpFunctionCall %void %textureDimensions_fcac78 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureDimensions_fcac78 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_fcac78 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureDimensions_fcac78 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_fcac78 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl index 9d4ec3404f..a5ca00a08b 100644 --- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureDimensions_fcac78() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureDimensions_fcac78(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl index 851d695fb1..15c989166a 100644 --- a/test/intrinsics/gen/textureLoad/050c33.wgsl +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl @@ -28,8 +28,9 @@ fn textureLoad_050c33() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_050c33(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl index 8d3867fd45..e286d634e5 100644 --- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_050c33() { uint4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_050c33(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm index a51c3153ca..53494b3b99 100644 --- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_050c33 "textureLoad_050c33" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_050c33 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_050c33 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_050c33 + %33 = OpFunctionCall %void %textureLoad_050c33 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_050c33 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_050c33 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_050c33 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_050c33 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl index 3f9f0d4f7e..e02cdf028a 100644 --- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_050c33() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_050c33(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl index db79f26bab..b1b917efe4 100644 --- a/test/intrinsics/gen/textureLoad/072e26.wgsl +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl @@ -28,8 +28,9 @@ fn textureLoad_072e26() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_072e26(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl index ac98d37713..808d51c5fa 100644 --- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_072e26() { float4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_072e26(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm index 0294e5f6a0..a8951cb33b 100644 --- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_072e26 "textureLoad_072e26" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,38 +32,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_072e26 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %19 - OpStore %res %12 +%textureLoad_072e26 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %22 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_072e26 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_072e26 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_072e26 + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_072e26 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_072e26 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl index 2aa87e5ac1..be1af70c6c 100644 --- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_072e26() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_072e26(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl index 8d8dad3083..4546bd6716 100644 --- a/test/intrinsics/gen/textureLoad/078bc4.wgsl +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl @@ -28,8 +28,9 @@ fn textureLoad_078bc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_078bc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl index 794a8fa3a7..75a3b4e57b 100644 --- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_078bc4() { float4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_078bc4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm index ecf39b1f8e..197f248b48 100644 --- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_078bc4 "textureLoad_078bc4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_078bc4 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_078bc4 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_078bc4 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_078bc4 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_078bc4 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_078bc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_078bc4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl index b93303fd49..f2f0460a61 100644 --- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_078bc4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_078bc4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl index 8070e3cda9..f30845c97a 100644 --- a/test/intrinsics/gen/textureLoad/127e12.wgsl +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl @@ -28,8 +28,9 @@ fn textureLoad_127e12() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_127e12(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl index c4a8638c26..b1efa7f15c 100644 --- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_127e12() { uint4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_127e12(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm index 28b884f0fc..91bdb87ec6 100644 --- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 34 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_127e12 "textureLoad_127e12" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,38 +33,50 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %23 = OpConstantNull %v4uint + %27 = OpConstantNull %v4uint + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_127e12 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %23 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %20 - OpStore %res %13 +%textureLoad_127e12 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %27 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %24 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %25 = OpLabel +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float + %31 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %33 = OpLabel OpStore %tint_pointsize %float_1 - %27 = OpFunctionCall %void %textureLoad_127e12 + %35 = OpFunctionCall %void %textureLoad_127e12 + %36 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_127e12 +%fragment_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_127e12 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %32 = OpLabel - %33 = OpFunctionCall %void %textureLoad_127e12 +%compute_main = OpFunction %void None %13 + %41 = OpLabel + %42 = OpFunctionCall %void %textureLoad_127e12 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl index 1890d11908..aed5d39d35 100644 --- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_127e12() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_127e12(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl index 44c713e190..c80775f98c 100644 --- a/test/intrinsics/gen/textureLoad/1561a7.wgsl +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl @@ -28,8 +28,9 @@ fn textureLoad_1561a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1561a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl index c571701228..74ea85660a 100644 --- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_1561a7() { uint4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_1561a7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm index aa226e0493..a25cc2b2a7 100644 --- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_1561a7 "textureLoad_1561a7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %20 = OpConstantNull %v4uint + %24 = OpConstantNull %v4uint + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_1561a7 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %int_1 - OpStore %res %13 +%textureLoad_1561a7 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_1561a7 + %32 = OpFunctionCall %void %textureLoad_1561a7 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_1561a7 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_1561a7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_1561a7 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_1561a7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl index 85e7bac062..4aa8b44eea 100644 --- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_1561a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1561a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl index 561eea2f15..aec562bf2b 100644 --- a/test/intrinsics/gen/textureLoad/19cf87.wgsl +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl @@ -28,8 +28,9 @@ fn textureLoad_19cf87() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_19cf87(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl index dfaa30b201..5f11c6af50 100644 --- a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_19cf87() { float res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_19cf87(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm index 08cba67b1a..dfa8896351 100644 --- a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_19cf87 "textureLoad_19cf87" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,37 +31,48 @@ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_float = OpTypePointer Function %float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_19cf87 = OpFunction %void None %8 - %11 = OpLabel +%textureLoad_19cf87 = OpFunction %void None %12 + %15 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4float %15 %18 Lod %int_1 - %12 = OpCompositeExtract %float %13 0 - OpStore %res %12 + %18 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4float %18 %21 Lod %int_1 + %16 = OpCompositeExtract %float %17 0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel - OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_19cf87 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_19cf87 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %8 +%vertex_main = OpFunction %void None %12 %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_19cf87 + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureLoad_19cf87 + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_19cf87 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_19cf87 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl index 6170911cd2..91d4c2e77f 100644 --- a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_19cf87() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_19cf87(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl index 4d030e7663..d4816139ca 100644 --- a/test/intrinsics/gen/textureLoad/1a062f.wgsl +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl @@ -28,8 +28,9 @@ fn textureLoad_1a062f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1a062f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl index d55f5bf95f..dcdfed8d69 100644 --- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_1a062f() { float4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_1a062f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm index 9fa17bc79b..dcc4463903 100644 --- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_1a062f "textureLoad_1a062f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,38 +32,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_1a062f = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %19 - OpStore %res %12 +%textureLoad_1a062f = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %22 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_1a062f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_1a062f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_1a062f + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_1a062f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_1a062f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl index 81a3f1fda3..7c6460a1d7 100644 --- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_1a062f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1a062f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl index 33f2e74ebe..3f0239d295 100644 --- a/test/intrinsics/gen/textureLoad/1a8452.wgsl +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl @@ -28,8 +28,9 @@ fn textureLoad_1a8452() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1a8452(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl index ca566ee72a..3df19c6e76 100644 --- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_1a8452() { uint4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_1a8452(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm index 33cabbbd24..024845b8b6 100644 --- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_1a8452 "textureLoad_1a8452" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %20 = OpConstantNull %v4uint + %24 = OpConstantNull %v4uint + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_1a8452 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %int_1 - OpStore %res %13 +%textureLoad_1a8452 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_1a8452 + %32 = OpFunctionCall %void %textureLoad_1a8452 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_1a8452 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_1a8452 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_1a8452 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_1a8452 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl index ac00f2b31a..61bda65f4d 100644 --- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_1a8452() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1a8452(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl index 9f9aa3c14e..ff1bc98106 100644 --- a/test/intrinsics/gen/textureLoad/1b8588.wgsl +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl @@ -28,8 +28,9 @@ fn textureLoad_1b8588() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1b8588(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl index 2839532ab6..3e094b8471 100644 --- a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_1b8588() { uint4 res = arg_0.Load(int2(1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_1b8588(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm index bbb2eb8800..718494f697 100644 --- a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability Sampled1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_1b8588 "textureLoad_1b8588" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %uint 1D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %20 = OpConstantNull %v4uint + %24 = OpConstantNull %v4uint + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_1b8588 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4uint %15 %int_1 Lod %int_1 - OpStore %res %13 +%textureLoad_1b8588 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4uint %19 %int_1 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_1b8588 + %32 = OpFunctionCall %void %textureLoad_1b8588 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_1b8588 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_1b8588 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_1b8588 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_1b8588 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl index 643b291b75..b9210995d1 100644 --- a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_1b8588() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1b8588(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl index 9203100006..d547cfba4c 100644 --- a/test/intrinsics/gen/textureLoad/1f2016.wgsl +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl @@ -28,8 +28,9 @@ fn textureLoad_1f2016() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1f2016(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl index 58fdcc6684..d4d251383a 100644 --- a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_1f2016() { float4 res = arg_0.Load(int4(0, 0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_1f2016(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm index e619f07599..75b765a2f8 100644 --- a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_1f2016 "textureLoad_1f2016" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,37 +31,47 @@ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %21 = OpConstantNull %v4float + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_1f2016 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %21 - %14 = OpLoad %7 %arg_0 - %12 = OpImageFetch %v4float %14 %17 Lod %int_1 - OpStore %res %12 +%textureLoad_1f2016 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageFetch %v4float %17 %20 Lod %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel - OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_1f2016 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_1f2016 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 %31 = OpFunctionCall %void %textureLoad_1f2016 + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_1f2016 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_1f2016 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl index 94202f9d50..895b7023bc 100644 --- a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_1f2016() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_1f2016(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl index 3ea6735268..07159329f0 100644 --- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl @@ -28,8 +28,9 @@ fn textureLoad_20fa2f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_20fa2f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl index ad5376ed4f..addc787efa 100644 --- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_20fa2f() { float4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_20fa2f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm index 38e66ad537..131ef51433 100644 --- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_20fa2f "textureLoad_20fa2f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,38 +33,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_20fa2f = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %19 - OpStore %res %12 +%textureLoad_20fa2f = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %22 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_20fa2f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_20fa2f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_20fa2f + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_20fa2f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_20fa2f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl index ef0765a76f..1f5f4cf9d2 100644 --- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_20fa2f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_20fa2f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl index 8a841e7f6b..1f543c69eb 100644 --- a/test/intrinsics/gen/textureLoad/276a2c.wgsl +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl @@ -28,8 +28,9 @@ fn textureLoad_276a2c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_276a2c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl index 1e7103a351..aa337f11b1 100644 --- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_276a2c() { uint4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_276a2c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm index fa976935aa..4df96801ba 100644 --- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_276a2c "textureLoad_276a2c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %20 = OpConstantNull %v4uint + %24 = OpConstantNull %v4uint + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_276a2c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %int_1 - OpStore %res %13 +%textureLoad_276a2c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_276a2c + %32 = OpFunctionCall %void %textureLoad_276a2c + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_276a2c +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_276a2c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_276a2c +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_276a2c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl index b8110cd051..03d832b43c 100644 --- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_276a2c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_276a2c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl index 1f2018cd06..961fba0154 100644 --- a/test/intrinsics/gen/textureLoad/2887d7.wgsl +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl @@ -28,8 +28,9 @@ fn textureLoad_2887d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_2887d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl index b3b3d1e11c..9e78927e0a 100644 --- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_2887d7() { float4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_2887d7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm index 8a626fda5c..e78db05af7 100644 --- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_2887d7 "textureLoad_2887d7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_2887d7 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %int_1 - OpStore %res %12 +%textureLoad_2887d7 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_2887d7 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_2887d7 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_2887d7 + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_2887d7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_2887d7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl index fdcb0fdb8a..1e7da98796 100644 --- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_2887d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_2887d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl index 6f9958fdc3..0c5b1e6838 100644 --- a/test/intrinsics/gen/textureLoad/2ae485.wgsl +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl @@ -28,8 +28,9 @@ fn textureLoad_2ae485() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_2ae485(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl index f7bc458453..11ca6c7bef 100644 --- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_2ae485() { int4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_2ae485(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm index 017de96d41..988dba1a5b 100644 --- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_2ae485 "textureLoad_2ae485" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_2ae485 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_2ae485 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_2ae485 + %32 = OpFunctionCall %void %textureLoad_2ae485 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_2ae485 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_2ae485 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_2ae485 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_2ae485 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl index c15430ec5d..94ee8c4514 100644 --- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_2ae485() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_2ae485(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl index c04b9f55a2..d5d2260b8d 100644 --- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl @@ -28,8 +28,9 @@ fn textureLoad_2d6cf7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_2d6cf7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl index b747bda73f..ac1b9b7049 100644 --- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_2d6cf7() { int4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_2d6cf7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm index dc721143ef..988604b1f7 100644 --- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_2d6cf7 "textureLoad_2d6cf7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %19 = OpConstantNull %v4int + %23 = OpConstantNull %v4int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_2d6cf7 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %int_1 - OpStore %res %13 +%textureLoad_2d6cf7 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_2d6cf7 + %31 = OpFunctionCall %void %textureLoad_2d6cf7 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_2d6cf7 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_2d6cf7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_2d6cf7 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_2d6cf7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl index 1ada16934b..ead2ebf42f 100644 --- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_2d6cf7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_2d6cf7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl index eccc28c8df..a22a1dbc4a 100644 --- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl @@ -28,8 +28,9 @@ fn textureLoad_3c0d9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3c0d9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl index 560a7c3cf6..74eb0eeae3 100644 --- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_3c0d9e() { uint4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_3c0d9e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm index 0dee741e4c..fbc42a7966 100644 --- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_3c0d9e "textureLoad_3c0d9e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_3c0d9e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_3c0d9e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_3c0d9e + %33 = OpFunctionCall %void %textureLoad_3c0d9e + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_3c0d9e +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_3c0d9e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_3c0d9e +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_3c0d9e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl index 36608fe9a1..90a425b818 100644 --- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_3c0d9e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3c0d9e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl index 9d4616b5c7..dde893f507 100644 --- a/test/intrinsics/gen/textureLoad/3c9587.wgsl +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl @@ -28,8 +28,9 @@ fn textureLoad_3c9587() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3c9587(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl index a351a5605a..3cc65d95fb 100644 --- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_3c9587() { float4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_3c9587(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm index a2090115ed..b3580848de 100644 --- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_3c9587 "textureLoad_3c9587" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_3c9587 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_3c9587 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_3c9587 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_3c9587 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_3c9587 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_3c9587 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_3c9587 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl index 887771f560..c0e77d0831 100644 --- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_3c9587() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3c9587(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl index 5c663cde82..52b5b7b5c7 100644 --- a/test/intrinsics/gen/textureLoad/3d001b.wgsl +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl @@ -28,8 +28,9 @@ fn textureLoad_3d001b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3d001b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl index 0576fe6a6d..09191759f1 100644 --- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_3d001b() { int4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_3d001b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm index 61dba8ee16..efff9eb660 100644 --- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_3d001b "textureLoad_3d001b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_3d001b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_3d001b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_3d001b + %32 = OpFunctionCall %void %textureLoad_3d001b + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_3d001b +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_3d001b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_3d001b +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_3d001b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl index 3ef3d15963..47f2b47ecd 100644 --- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_3d001b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3d001b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl index 09e6edeaca..5b916fcd72 100644 --- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl @@ -28,8 +28,9 @@ fn textureLoad_3d9c90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3d9c90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl index e169362470..e9918541f9 100644 --- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_3d9c90() { float4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_3d9c90(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm index b41a43305d..0e81340aa7 100644 --- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_3d9c90 "textureLoad_3d9c90" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_3d9c90 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_3d9c90 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_3d9c90 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_3d9c90 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_3d9c90 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_3d9c90 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_3d9c90 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl index 546b4dce36..51108201ce 100644 --- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_3d9c90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_3d9c90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl index 941c5c1e06..44ba759cdd 100644 --- a/test/intrinsics/gen/textureLoad/484344.wgsl +++ b/test/intrinsics/gen/textureLoad/484344.wgsl @@ -28,8 +28,9 @@ fn textureLoad_484344() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_484344(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl index 76de864e55..69a42dbb03 100644 --- a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_484344() { float4 res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_484344(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm index 083475d27a..df04a3ff04 100644 --- a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_484344 "textureLoad_484344" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,37 +31,47 @@ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %21 = OpConstantNull %v4float + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_484344 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %21 - %14 = OpLoad %7 %arg_0 - %12 = OpImageFetch %v4float %14 %17 Lod %int_1 - OpStore %res %12 +%textureLoad_484344 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageFetch %v4float %17 %20 Lod %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel - OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_484344 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_484344 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 %31 = OpFunctionCall %void %textureLoad_484344 + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_484344 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_484344 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl index 8776b0a488..054b07949f 100644 --- a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_484344() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_484344(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl index 747d2ad8fa..e55655d814 100644 --- a/test/intrinsics/gen/textureLoad/4fd803.wgsl +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl @@ -28,8 +28,9 @@ fn textureLoad_4fd803() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_4fd803(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl index 7e4d6c0c8b..e2cb13e50a 100644 --- a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_4fd803() { int4 res = arg_0.Load(int4(0, 0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_4fd803(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm index 8ca0c65438..4387f2bca6 100644 --- a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_4fd803 "textureLoad_4fd803" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,48 @@ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %21 = OpConstantNull %v4int + %25 = OpConstantNull %v4int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_4fd803 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4int %15 %17 Lod %int_1 - OpStore %res %13 +%textureLoad_4fd803 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4int %19 %21 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_4fd803 + %33 = OpFunctionCall %void %textureLoad_4fd803 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_4fd803 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_4fd803 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_4fd803 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_4fd803 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl index 6bea105443..45ce29145a 100644 --- a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_4fd803() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_4fd803(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl index 476e534c5a..7ca4b043f1 100644 --- a/test/intrinsics/gen/textureLoad/505aa2.wgsl +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl @@ -28,8 +28,9 @@ fn textureLoad_505aa2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_505aa2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl index df305d098d..587912c40c 100644 --- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_505aa2() { int4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_505aa2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm index 799937e0db..48057a75f6 100644 --- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_505aa2 "textureLoad_505aa2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 3D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_505aa2 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_505aa2 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_505aa2 + %32 = OpFunctionCall %void %textureLoad_505aa2 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_505aa2 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_505aa2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_505aa2 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_505aa2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl index 380f1f9e1d..4e4c98561e 100644 --- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_505aa2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_505aa2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl index 018941a748..6d2ffff08a 100644 --- a/test/intrinsics/gen/textureLoad/519ab5.wgsl +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl @@ -28,8 +28,9 @@ fn textureLoad_519ab5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_519ab5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl index 2a8f26b15a..2dbc3ca3a1 100644 --- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_519ab5() { float4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_519ab5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm index 6afde5058f..3eb5d5aba5 100644 --- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_519ab5 "textureLoad_519ab5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_519ab5 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %int_1 - OpStore %res %12 +%textureLoad_519ab5 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_519ab5 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_519ab5 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_519ab5 + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_519ab5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_519ab5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl index 2135d0d24d..aa8b4a4cbe 100644 --- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_519ab5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_519ab5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl index 7b226353ad..518b5d49f5 100644 --- a/test/intrinsics/gen/textureLoad/53378a.wgsl +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl @@ -28,8 +28,9 @@ fn textureLoad_53378a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_53378a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl index 0d1db96640..784f6e41e4 100644 --- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_53378a() { int4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_53378a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm index b916b86fd7..795cae1072 100644 --- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_53378a "textureLoad_53378a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_53378a = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_53378a = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_53378a + %32 = OpFunctionCall %void %textureLoad_53378a + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_53378a +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_53378a OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_53378a +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_53378a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl index 0310fa33ea..d06470068f 100644 --- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_53378a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_53378a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl index 172dccdb14..b231a5dd17 100644 --- a/test/intrinsics/gen/textureLoad/560573.wgsl +++ b/test/intrinsics/gen/textureLoad/560573.wgsl @@ -28,8 +28,9 @@ fn textureLoad_560573() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_560573(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl index 45432121db..f5ac476b8c 100644 --- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_560573() { int4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_560573(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm index 36259a75e4..79227601c2 100644 --- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_560573 "textureLoad_560573" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %int 2D 0 1 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %22 = OpConstantNull %v4int + %26 = OpConstantNull %v4int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_560573 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %19 - OpStore %res %13 +%textureLoad_560573 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %23 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_560573 + %34 = OpFunctionCall %void %textureLoad_560573 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_560573 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_560573 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_560573 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_560573 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl index 3a6f48e001..e464c72111 100644 --- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_560573() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_560573(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl index 07d3370253..d1dd7003c0 100644 --- a/test/intrinsics/gen/textureLoad/582015.wgsl +++ b/test/intrinsics/gen/textureLoad/582015.wgsl @@ -28,8 +28,9 @@ fn textureLoad_582015() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_582015(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl index cb7a09495e..42e6c5b27e 100644 --- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_582015() { int4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_582015(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm index 0af201a3fb..8ab0dc0406 100644 --- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_582015 "textureLoad_582015" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %22 = OpConstantNull %v4int + %26 = OpConstantNull %v4int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_582015 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %19 - OpStore %res %13 +%textureLoad_582015 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %23 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_582015 + %34 = OpFunctionCall %void %textureLoad_582015 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_582015 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_582015 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_582015 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_582015 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl index 21b62375ba..07a18afd72 100644 --- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_582015() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_582015(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl index 1b876abe83..ff4b817fc5 100644 --- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl @@ -28,8 +28,9 @@ fn textureLoad_5a2f9d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_5a2f9d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl index 2d4ad36a30..26e3af2d02 100644 --- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_5a2f9d() { int4 res = arg_0.Load(int2(1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_5a2f9d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm index 82ae564813..dffe9a1b42 100644 --- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Sampled1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_5a2f9d "textureLoad_5a2f9d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %int 1D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %19 = OpConstantNull %v4int + %23 = OpConstantNull %v4int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_5a2f9d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4int %15 %int_1 Lod %int_1 - OpStore %res %13 +%textureLoad_5a2f9d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4int %19 %int_1 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_5a2f9d + %31 = OpFunctionCall %void %textureLoad_5a2f9d + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_5a2f9d +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_5a2f9d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_5a2f9d +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_5a2f9d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl index 22da997482..28a202b60a 100644 --- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_5a2f9d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_5a2f9d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl index a698444034..66b788ec82 100644 --- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl @@ -28,8 +28,9 @@ fn textureLoad_5bb7fb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_5bb7fb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl index 82ce725c7b..3ea73c13d2 100644 --- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_5bb7fb() { uint4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_5bb7fb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm index e82fd45ebc..45b99cab09 100644 --- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_5bb7fb "textureLoad_5bb7fb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,35 +35,47 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %20 = OpConstantNull %v4uint + %24 = OpConstantNull %v4uint + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_5bb7fb = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %int_1 - OpStore %res %13 +%textureLoad_5bb7fb = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_5bb7fb + %32 = OpFunctionCall %void %textureLoad_5bb7fb + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_5bb7fb +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_5bb7fb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_5bb7fb +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_5bb7fb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl index 9336c2d7fc..28eb64c18b 100644 --- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_5bb7fb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_5bb7fb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl index 605696e7a3..19039d6eba 100644 --- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl @@ -28,8 +28,9 @@ fn textureLoad_5d0a2f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_5d0a2f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl index 279b8b2d82..5bc1492d07 100644 --- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_5d0a2f() { uint4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_5d0a2f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm index 1393b72268..eb612ce4ac 100644 --- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 34 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_5d0a2f "textureLoad_5d0a2f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,38 +33,50 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %23 = OpConstantNull %v4uint + %27 = OpConstantNull %v4uint + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_5d0a2f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %23 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %20 - OpStore %res %13 +%textureLoad_5d0a2f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %27 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %24 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %25 = OpLabel +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float + %31 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %33 = OpLabel OpStore %tint_pointsize %float_1 - %27 = OpFunctionCall %void %textureLoad_5d0a2f + %35 = OpFunctionCall %void %textureLoad_5d0a2f + %36 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_5d0a2f +%fragment_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_5d0a2f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %32 = OpLabel - %33 = OpFunctionCall %void %textureLoad_5d0a2f +%compute_main = OpFunction %void None %13 + %41 = OpLabel + %42 = OpFunctionCall %void %textureLoad_5d0a2f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl index 57d879a33f..281d549860 100644 --- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_5d0a2f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_5d0a2f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl index 4cffca10a3..3ef3e3fb2f 100644 --- a/test/intrinsics/gen/textureLoad/6154d4.wgsl +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl @@ -28,8 +28,9 @@ fn textureLoad_6154d4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_6154d4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl index f66dcc0e37..505dd5b245 100644 --- a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_6154d4() { uint4 res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_6154d4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm index c9b3a24090..86aaa23391 100644 --- a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_6154d4 "textureLoad_6154d4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %22 = OpConstantNull %v4uint + %26 = OpConstantNull %v4uint + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_6154d4 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4uint %15 %18 Lod %int_1 - OpStore %res %13 +%textureLoad_6154d4 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4uint %19 %22 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_6154d4 + %34 = OpFunctionCall %void %textureLoad_6154d4 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_6154d4 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_6154d4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_6154d4 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_6154d4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl index 21aa49a5a8..c9eec01fc7 100644 --- a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_6154d4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_6154d4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl index c3e1ed0b34..f8bcc8c0ef 100644 --- a/test/intrinsics/gen/textureLoad/62d125.wgsl +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl @@ -28,8 +28,9 @@ fn textureLoad_62d125() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_62d125(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl index d099ebfc98..a00da07860 100644 --- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_62d125() { float4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_62d125(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm index 34ab6f8678..3dda8980c2 100644 --- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_62d125 "textureLoad_62d125" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_62d125 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_62d125 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_62d125 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_62d125 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_62d125 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_62d125 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_62d125 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl index 1035db6995..a0f70c0464 100644 --- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_62d125() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_62d125(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl index d862939b90..b9193215a4 100644 --- a/test/intrinsics/gen/textureLoad/6678b6.wgsl +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl @@ -28,8 +28,9 @@ fn textureLoad_6678b6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_6678b6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl index c412e7caf1..299001d571 100644 --- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_6678b6() { int4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_6678b6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm index d0098edeaf..a6aa4bb6a5 100644 --- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_6678b6 "textureLoad_6678b6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %19 = OpConstantNull %v4int + %23 = OpConstantNull %v4int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_6678b6 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %int_1 - OpStore %res %13 +%textureLoad_6678b6 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_6678b6 + %31 = OpFunctionCall %void %textureLoad_6678b6 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_6678b6 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_6678b6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_6678b6 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_6678b6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl index 65efde1f43..3eede21498 100644 --- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_6678b6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_6678b6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl index 934f63268f..bce74a8683 100644 --- a/test/intrinsics/gen/textureLoad/67edca.wgsl +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl @@ -28,8 +28,9 @@ fn textureLoad_67edca() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_67edca(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl index ef0fc2763c..b84fd9ebdb 100644 --- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_67edca() { uint4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_67edca(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm index 5e131820fc..a5092e1cab 100644 --- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_67edca "textureLoad_67edca" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_67edca = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_67edca = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_67edca + %33 = OpFunctionCall %void %textureLoad_67edca + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_67edca +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_67edca OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_67edca +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_67edca OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl index 48f60e91ef..aae3e6c22a 100644 --- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_67edca() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_67edca(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl index ecb0e5ce02..d0b114014f 100644 --- a/test/intrinsics/gen/textureLoad/749704.wgsl +++ b/test/intrinsics/gen/textureLoad/749704.wgsl @@ -28,8 +28,9 @@ fn textureLoad_749704() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_749704(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl index 8743700f7c..6e534088c9 100644 --- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_749704() { uint4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_749704(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm index 9826b952d3..09d9512479 100644 --- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_749704 "textureLoad_749704" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_749704 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_749704 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_749704 + %33 = OpFunctionCall %void %textureLoad_749704 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_749704 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_749704 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_749704 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_749704 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl index ac72def213..40aa2c4b92 100644 --- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_749704() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_749704(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl index 2beff2a1a6..bda80ded9e 100644 --- a/test/intrinsics/gen/textureLoad/79e697.wgsl +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl @@ -28,8 +28,9 @@ fn textureLoad_79e697() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_79e697(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl index d7eef53001..de1d8ac605 100644 --- a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_79e697() { int4 res = arg_0.Load(int4(0, 0, 1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_79e697(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm index a58844337e..8c010bc31c 100644 --- a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_79e697 "textureLoad_79e697" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %22 = OpConstantNull %v4int + %26 = OpConstantNull %v4int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_79e697 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4int %15 %19 Lod %int_1 - OpStore %res %13 +%textureLoad_79e697 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4int %19 %23 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_79e697 + %34 = OpFunctionCall %void %textureLoad_79e697 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_79e697 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_79e697 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_79e697 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_79e697 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl index f22e4e2644..5fc45731a2 100644 --- a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_79e697() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_79e697(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl index c45502f92a..073bf9f86b 100644 --- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl @@ -28,8 +28,9 @@ fn textureLoad_7c90e5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_7c90e5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl index d04ec21070..bfa8878570 100644 --- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_7c90e5() { uint4 res = arg_0.Load(int4(0, 0, 1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_7c90e5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm index 238c6785eb..ff1f583dcb 100644 --- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 34 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_7c90e5 "textureLoad_7c90e5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,38 +32,50 @@ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %23 = OpConstantNull %v4uint + %27 = OpConstantNull %v4uint + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_7c90e5 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %23 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4uint %15 %20 Lod %int_1 - OpStore %res %13 +%textureLoad_7c90e5 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %27 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4uint %19 %24 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %25 = OpLabel +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float + %31 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %33 = OpLabel OpStore %tint_pointsize %float_1 - %27 = OpFunctionCall %void %textureLoad_7c90e5 + %35 = OpFunctionCall %void %textureLoad_7c90e5 + %36 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_7c90e5 +%fragment_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_7c90e5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %32 = OpLabel - %33 = OpFunctionCall %void %textureLoad_7c90e5 +%compute_main = OpFunction %void None %13 + %41 = OpLabel + %42 = OpFunctionCall %void %textureLoad_7c90e5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl index e5ebce3269..7b287ca2ca 100644 --- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_7c90e5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_7c90e5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl index 8d1b0cb36f..d67162f67c 100644 --- a/test/intrinsics/gen/textureLoad/81c381.wgsl +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl @@ -28,8 +28,9 @@ fn textureLoad_81c381() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_81c381(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl index fdca8d18d8..a998818066 100644 --- a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_81c381() { float4 res = arg_0.Load(int2(1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_81c381(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm index b5702bba99..507f5f4a38 100644 --- a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Sampled1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_81c381 "textureLoad_81c381" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,45 @@ %7 = OpTypeImage %float 1D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_81c381 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageFetch %v4float %14 %int_1 Lod %int_1 - OpStore %res %12 +%textureLoad_81c381 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageFetch %v4float %17 %int_1 Lod %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_81c381 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_81c381 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_81c381 + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_81c381 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_81c381 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl index 458368bdbe..8eee6062bf 100644 --- a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_81c381() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_81c381(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl index 097007a62a..fe0a681fd6 100644 --- a/test/intrinsics/gen/textureLoad/83cea4.wgsl +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl @@ -28,8 +28,9 @@ fn textureLoad_83cea4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_83cea4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl index decc049b86..57b1ada5f1 100644 --- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_83cea4() { uint4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_83cea4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm index 73bb99c614..b4e9a02ead 100644 --- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_83cea4 "textureLoad_83cea4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %20 = OpConstantNull %v4uint + %24 = OpConstantNull %v4uint + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_83cea4 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %int_1 - OpStore %res %13 +%textureLoad_83cea4 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_83cea4 + %32 = OpFunctionCall %void %textureLoad_83cea4 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_83cea4 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_83cea4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_83cea4 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_83cea4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl index 04820c2a2f..747041dfa2 100644 --- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_83cea4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_83cea4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl index 0ce5ed9cf4..0c03122647 100644 --- a/test/intrinsics/gen/textureLoad/87be85.wgsl +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl @@ -28,8 +28,9 @@ fn textureLoad_87be85() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_87be85(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl index 776a68d70d..80ebe7461b 100644 --- a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_87be85() { float4 res = arg_0.Load(int4(0, 0, 1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_87be85(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm index bb3b579f8c..45fb473d20 100644 --- a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_87be85 "textureLoad_87be85" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,38 +31,48 @@ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_87be85 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageFetch %v4float %14 %19 Lod %int_1 - OpStore %res %12 +%textureLoad_87be85 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageFetch %v4float %17 %22 Lod %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_87be85 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_87be85 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_87be85 + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_87be85 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_87be85 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl index 5029fffbf2..aff0007ec3 100644 --- a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_87be85() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_87be85(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl index f5e787e0ad..8e92b1e27c 100644 --- a/test/intrinsics/gen/textureLoad/8acf41.wgsl +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl @@ -28,8 +28,9 @@ fn textureLoad_8acf41() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_8acf41(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl index 7ea3d470ae..66a7786b22 100644 --- a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_8acf41() { float4 res = arg_0.Load(int3(0, 0, 0), 0); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_8acf41(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm index c639aff707..7f64a6b4f6 100644 --- a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_8acf41 "textureLoad_8acf41" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,37 +31,47 @@ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %int_0 = OpConstant %int 0 %_ptr_Function_v4float = OpTypePointer Function %v4float - %21 = OpConstantNull %v4float + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_8acf41 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %21 - %14 = OpLoad %7 %arg_0 - %12 = OpImageFetch %v4float %14 %17 Lod %int_0 - OpStore %res %12 +%textureLoad_8acf41 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageFetch %v4float %17 %20 Lod %int_0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel - OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_8acf41 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_8acf41 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 %31 = OpFunctionCall %void %textureLoad_8acf41 + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_8acf41 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_8acf41 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl index fc9278eda2..e618619f3c 100644 --- a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_8acf41() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_8acf41(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl index 16885de4d8..ac7f62e3d4 100644 --- a/test/intrinsics/gen/textureLoad/8e5032.wgsl +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl @@ -28,8 +28,9 @@ fn textureLoad_8e5032() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_8e5032(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl index 3b15dee5aa..835ba46de7 100644 --- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_8e5032() { uint4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_8e5032(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm index d348de0c11..905a82efb9 100644 --- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 34 +; Bound: 43 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_8e5032 "textureLoad_8e5032" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,38 +34,50 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %23 = OpConstantNull %v4uint + %27 = OpConstantNull %v4uint + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_8e5032 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %23 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %20 - OpStore %res %13 +%textureLoad_8e5032 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %27 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %24 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %25 = OpLabel +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float + %31 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %33 = OpLabel OpStore %tint_pointsize %float_1 - %27 = OpFunctionCall %void %textureLoad_8e5032 + %35 = OpFunctionCall %void %textureLoad_8e5032 + %36 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_8e5032 +%fragment_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_8e5032 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %32 = OpLabel - %33 = OpFunctionCall %void %textureLoad_8e5032 +%compute_main = OpFunction %void None %13 + %41 = OpLabel + %42 = OpFunctionCall %void %textureLoad_8e5032 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl index e3d7995edc..eda9388842 100644 --- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_8e5032() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_8e5032(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl index 8354199aed..52b40fb1aa 100644 --- a/test/intrinsics/gen/textureLoad/936952.wgsl +++ b/test/intrinsics/gen/textureLoad/936952.wgsl @@ -28,8 +28,9 @@ fn textureLoad_936952() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_936952(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl index 416f4e1324..6d6f30ea0c 100644 --- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_936952() { float4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_936952(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm index 57aab33e7f..f9a43f4c85 100644 --- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_936952 "textureLoad_936952" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,38 +32,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_936952 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %19 - OpStore %res %12 +%textureLoad_936952 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %22 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_936952 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_936952 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_936952 + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_936952 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_936952 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl index 618a8cfaf1..750c3efec0 100644 --- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_936952() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_936952(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl index 6d893bbef2..8106700b3a 100644 --- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl @@ -28,8 +28,9 @@ fn textureLoad_9a7c90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_9a7c90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl index 65f8c55a17..827f7878a7 100644 --- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_9a7c90() { uint4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_9a7c90(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm index 3e11609a43..4225db9a47 100644 --- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_9a7c90 "textureLoad_9a7c90" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_9a7c90 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_9a7c90 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_9a7c90 + %33 = OpFunctionCall %void %textureLoad_9a7c90 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_9a7c90 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_9a7c90 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_9a7c90 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_9a7c90 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl index 99b2bda802..355df010b8 100644 --- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_9a7c90() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_9a7c90(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl index a204e9dd46..2e755b008d 100644 --- a/test/intrinsics/gen/textureLoad/9b2667.wgsl +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl @@ -28,8 +28,9 @@ fn textureLoad_9b2667() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_9b2667(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl index 5bd840f1b2..21528189f8 100644 --- a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_9b2667() { float res = arg_0.Load(int4(0, 0, 1, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_9b2667(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm index 8d6f3b267e..ca6067834c 100644 --- a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_9b2667 "textureLoad_9b2667" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,38 +31,49 @@ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_float = OpTypePointer Function %float + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_9b2667 = OpFunction %void None %8 - %11 = OpLabel +%textureLoad_9b2667 = OpFunction %void None %12 + %15 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4float %15 %20 Lod %int_1 - %12 = OpCompositeExtract %float %13 0 - OpStore %res %12 + %18 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4float %18 %23 Lod %int_1 + %16 = OpCompositeExtract %float %17 0 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_9b2667 +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_9b2667 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %8 +%vertex_main = OpFunction %void None %12 %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_9b2667 + OpStore %tint_pointsize %float_1 + %33 = OpFunctionCall %void %textureLoad_9b2667 + %34 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_9b2667 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_9b2667 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl index aa5e716e7f..2acf8e0b0b 100644 --- a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_9b2667() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_9b2667(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl index cf25b4b0c7..e1bfa9fc83 100644 --- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl @@ -28,8 +28,9 @@ fn textureLoad_9c2a14() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_9c2a14(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl index 52098a78e1..276225fae4 100644 --- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_9c2a14() { float4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_9c2a14(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm index 895e3cdb78..12be9be2dc 100644 --- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_9c2a14 "textureLoad_9c2a14" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_9c2a14 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_9c2a14 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_9c2a14 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_9c2a14 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_9c2a14 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_9c2a14 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_9c2a14 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl index fdd5a28aae..35f6a52015 100644 --- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_9c2a14() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_9c2a14(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl index 6b503a3130..e1689e8892 100644 --- a/test/intrinsics/gen/textureLoad/a583c9.wgsl +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl @@ -28,8 +28,9 @@ fn textureLoad_a583c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a583c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl index 58d4c230ac..eb15d89e7e 100644 --- a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureLoad_a583c9() { float4 res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_a583c9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm index d1d4806646..4bdec9cc20 100644 --- a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_a583c9 "textureLoad_a583c9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,37 +31,47 @@ %7 = OpTypeImage %float 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %21 = OpConstantNull %v4float + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_a583c9 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %21 - %14 = OpLoad %7 %arg_0 - %12 = OpImageFetch %v4float %14 %17 Sample %int_1 - OpStore %res %12 +%textureLoad_a583c9 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageFetch %v4float %17 %20 Sample %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %23 = OpLabel - OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_a583c9 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_a583c9 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %30 = OpLabel +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 %31 = OpFunctionCall %void %textureLoad_a583c9 + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_a583c9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_a583c9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl index 0eb7d2fc3e..dbe3069fda 100644 --- a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_a583c9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a583c9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl index 1c7be46357..4258aa8544 100644 --- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl @@ -28,8 +28,9 @@ fn textureLoad_a6a85a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a6a85a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl index c30dc1fc8a..7d1daa37bf 100644 --- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_a6a85a() { float4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_a6a85a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm index 43cd94e046..c596cecbe4 100644 --- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_a6a85a "textureLoad_a6a85a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_a6a85a = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_a6a85a = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_a6a85a - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_a6a85a + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_a6a85a + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_a6a85a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_a6a85a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl index 89dc933cee..4ad2dcdb46 100644 --- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_a6a85a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a6a85a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl index 52c4f5ff4a..7563b53fcb 100644 --- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl @@ -28,8 +28,9 @@ fn textureLoad_a6b61d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a6b61d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl index bdce0aebcc..2b2be1ca38 100644 --- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_a6b61d() { int4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_a6b61d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm index 0b8fdaa16d..c147986647 100644 --- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_a6b61d "textureLoad_a6b61d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %22 = OpConstantNull %v4int + %26 = OpConstantNull %v4int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_a6b61d = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %19 - OpStore %res %13 +%textureLoad_a6b61d = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %23 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_a6b61d + %34 = OpFunctionCall %void %textureLoad_a6b61d + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_a6b61d +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_a6b61d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_a6b61d +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_a6b61d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl index a3e63937a8..daf68a42c4 100644 --- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_a6b61d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a6b61d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl index 42d9f0b919..1513d1e9cb 100644 --- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl @@ -28,8 +28,9 @@ fn textureLoad_a7a3c3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a7a3c3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl index 791b428a36..e4dc952aa4 100644 --- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_a7a3c3() { int4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_a7a3c3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm index b068e66f02..c6402f50db 100644 --- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_a7a3c3 "textureLoad_a7a3c3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_a7a3c3 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_a7a3c3 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_a7a3c3 + %32 = OpFunctionCall %void %textureLoad_a7a3c3 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_a7a3c3 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_a7a3c3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_a7a3c3 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_a7a3c3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl index d6ad3c5ba3..fdd365212d 100644 --- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_a7a3c3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a7a3c3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl index a2861bff21..71fc60a491 100644 --- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl @@ -28,8 +28,9 @@ fn textureLoad_a9a9f5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a9a9f5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl index 9c47a89a89..197e7417f8 100644 --- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_a9a9f5() { uint4 res = arg_0.Load(int4(0, 0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_a9a9f5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm index 83b174d44b..a8b53e1e4d 100644 --- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_a9a9f5 "textureLoad_a9a9f5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %22 = OpConstantNull %v4uint + %26 = OpConstantNull %v4uint + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_a9a9f5 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4uint %15 %18 Lod %int_1 - OpStore %res %13 +%textureLoad_a9a9f5 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4uint %19 %22 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_a9a9f5 + %34 = OpFunctionCall %void %textureLoad_a9a9f5 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_a9a9f5 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_a9a9f5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_a9a9f5 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_a9a9f5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl index 5a07216148..f472d29afd 100644 --- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_a9a9f5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_a9a9f5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl index 9bdf7598fa..e642b98beb 100644 --- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl @@ -28,8 +28,9 @@ fn textureLoad_b1bf79() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_b1bf79(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl index f65c488956..259d694f86 100644 --- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_b1bf79() { int4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_b1bf79(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm index 168c98ac80..0f24aa326f 100644 --- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_b1bf79 "textureLoad_b1bf79" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_b1bf79 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_b1bf79 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_b1bf79 + %32 = OpFunctionCall %void %textureLoad_b1bf79 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_b1bf79 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_b1bf79 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_b1bf79 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_b1bf79 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl index c722eb37ce..92d14f4e21 100644 --- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_b1bf79() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_b1bf79(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl index 60239d068e..0c59154b02 100644 --- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl @@ -28,8 +28,9 @@ fn textureLoad_b58c6d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_b58c6d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl index 1989266af7..082b239ebc 100644 --- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_b58c6d() { float4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_b58c6d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm index 784789eca1..90c5ef434f 100644 --- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_b58c6d "textureLoad_b58c6d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,38 +32,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_b58c6d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %19 - OpStore %res %12 +%textureLoad_b58c6d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %22 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_b58c6d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_b58c6d + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_b58c6d + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_b58c6d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_b58c6d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl index 4f945bc297..f6bc2f413b 100644 --- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_b58c6d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_b58c6d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl index 3989081582..3a24ac5d30 100644 --- a/test/intrinsics/gen/textureLoad/b6c458.wgsl +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl @@ -28,8 +28,9 @@ fn textureLoad_b6c458() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_b6c458(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl index ae9a17e268..de41bd5a02 100644 --- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_b6c458() { uint4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_b6c458(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm index 40a4ccb0ef..e1939f4064 100644 --- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_b6c458 "textureLoad_b6c458" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_b6c458 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_b6c458 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_b6c458 + %33 = OpFunctionCall %void %textureLoad_b6c458 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_b6c458 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_b6c458 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_b6c458 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_b6c458 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl index 317bcc472f..4bf85458f0 100644 --- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_b6c458() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_b6c458(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl index 0ae454d65b..7da431f38a 100644 --- a/test/intrinsics/gen/textureLoad/bfd154.wgsl +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl @@ -28,8 +28,9 @@ fn textureLoad_bfd154() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_bfd154(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl index ef2856b2ca..829545daa8 100644 --- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_bfd154() { uint4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_bfd154(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm index 5fe780fd95..8a748cb90a 100644 --- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_bfd154 "textureLoad_bfd154" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_bfd154 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_bfd154 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_bfd154 + %33 = OpFunctionCall %void %textureLoad_bfd154 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_bfd154 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_bfd154 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_bfd154 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_bfd154 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl index 45d2471e66..0acf1d8dec 100644 --- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_bfd154() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_bfd154(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl index 88beec81ad..4561a352d5 100644 --- a/test/intrinsics/gen/textureLoad/c02b74.wgsl +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c02b74() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c02b74(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl index 0260e3b7c7..4ae0129251 100644 --- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_c02b74() { float4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c02b74(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm index 79294d52d9..9bba94025a 100644 --- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c02b74 "textureLoad_c02b74" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c02b74 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %int_1 - OpStore %res %12 +%textureLoad_c02b74 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_c02b74 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_c02b74 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_c02b74 + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_c02b74 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_c02b74 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl index 82ce81a253..855caf6fbb 100644 --- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c02b74() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c02b74(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl index 7fea1e2eb6..c4c53f2207 100644 --- a/test/intrinsics/gen/textureLoad/c07013.wgsl +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c07013() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c07013(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl index 66daded844..e68f69217d 100644 --- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_c07013() { float4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c07013(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm index 1ac9c62a6c..167cd45d94 100644 --- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c07013 "textureLoad_c07013" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c07013 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_c07013 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_c07013 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_c07013 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_c07013 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_c07013 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_c07013 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl index 4d5871808f..39db3518dc 100644 --- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c07013() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c07013(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl index 2736bfe8ee..ba6108ff63 100644 --- a/test/intrinsics/gen/textureLoad/c2a480.wgsl +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c2a480() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c2a480(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl index 95b3490fdc..272864fe0f 100644 --- a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_c2a480() { int4 res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c2a480(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm index 4c6fed79ad..05f013f1f6 100644 --- a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c2a480 "textureLoad_c2a480" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,48 @@ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %21 = OpConstantNull %v4int + %25 = OpConstantNull %v4int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c2a480 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4int %15 %17 Lod %int_1 - OpStore %res %13 +%textureLoad_c2a480 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4int %19 %21 Lod %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_c2a480 + %33 = OpFunctionCall %void %textureLoad_c2a480 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_c2a480 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_c2a480 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_c2a480 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_c2a480 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl index 41189cfc12..5a9704fd4e 100644 --- a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c2a480() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c2a480(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl index b602b0b6b9..e87185cc95 100644 --- a/test/intrinsics/gen/textureLoad/c378ee.wgsl +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c378ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c378ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl index 05ac6e1a59..72633ce31a 100644 --- a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureLoad_c378ee() { uint4 res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c378ee(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm index 5a547d0417..ce95a401a3 100644 --- a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c378ee "textureLoad_c378ee" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,37 +32,49 @@ %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %22 = OpConstantNull %v4uint + %26 = OpConstantNull %v4uint + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c378ee = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4uint %15 %18 Sample %int_1 - OpStore %res %13 +%textureLoad_c378ee = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4uint %19 %22 Sample %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_c378ee + %34 = OpFunctionCall %void %textureLoad_c378ee + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_c378ee +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_c378ee OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_c378ee +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_c378ee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl index f118f6e21b..aeefcf274e 100644 --- a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c378ee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c378ee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl index ba0ed97f10..c7c4f01c91 100644 --- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c40dcb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c40dcb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl index f12a0a9859..65968e37ec 100644 --- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_c40dcb() { uint4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c40dcb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm index 340717f7ad..a9bc04b571 100644 --- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 34 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c40dcb "textureLoad_c40dcb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,38 +33,50 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %23 = OpConstantNull %v4uint + %27 = OpConstantNull %v4uint + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c40dcb = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %23 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %20 - OpStore %res %13 +%textureLoad_c40dcb = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %27 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %24 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %25 = OpLabel +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float + %31 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %33 = OpLabel OpStore %tint_pointsize %float_1 - %27 = OpFunctionCall %void %textureLoad_c40dcb + %35 = OpFunctionCall %void %textureLoad_c40dcb + %36 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_c40dcb +%fragment_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_c40dcb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %32 = OpLabel - %33 = OpFunctionCall %void %textureLoad_c40dcb +%compute_main = OpFunction %void None %13 + %41 = OpLabel + %42 = OpFunctionCall %void %textureLoad_c40dcb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl index e215fc8c42..43965d8ca9 100644 --- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c40dcb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c40dcb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl index 484739de41..4a6f8cf70d 100644 --- a/test/intrinsics/gen/textureLoad/c456bc.wgsl +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c456bc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c456bc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl index e0648d8d74..f844a2d23c 100644 --- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_c456bc() { float4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c456bc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm index 92d96edd9a..4fe7b440e5 100644 --- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c456bc "textureLoad_c456bc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c456bc = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_c456bc = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_c456bc - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_c456bc + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_c456bc + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_c456bc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_c456bc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl index 0c3ace93af..a85b4e0d79 100644 --- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c456bc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c456bc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl index 983bfe3f9d..9a6fe84ac7 100644 --- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c7cbed() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c7cbed(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl index 1ad636dcdc..1aa1c654bd 100644 --- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_c7cbed() { float4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c7cbed(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm index d63ee64e12..7ffe7deae2 100644 --- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c7cbed "textureLoad_c7cbed" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c7cbed = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %int_1 - OpStore %res %12 +%textureLoad_c7cbed = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_c7cbed - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_c7cbed + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_c7cbed + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_c7cbed + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_c7cbed OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl index 76bbb348b4..4b772126ce 100644 --- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c7cbed() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c7cbed(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl index 0825e3e491..06ad93cc6d 100644 --- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl @@ -28,8 +28,9 @@ fn textureLoad_c9cc40() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c9cc40(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl index c46ef6a1c0..0b7eed0e7e 100644 --- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_c9cc40() { int4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_c9cc40(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm index 7716717014..753bb15318 100644 --- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_c9cc40 "textureLoad_c9cc40" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %19 = OpConstantNull %v4int + %23 = OpConstantNull %v4int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_c9cc40 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %int_1 - OpStore %res %13 +%textureLoad_c9cc40 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_c9cc40 + %31 = OpFunctionCall %void %textureLoad_c9cc40 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_c9cc40 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_c9cc40 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_c9cc40 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_c9cc40 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl index 8cc767084e..73ec9deb7f 100644 --- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_c9cc40() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_c9cc40(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl index 8578b8609e..80782569b2 100644 --- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl @@ -28,8 +28,9 @@ fn textureLoad_d5c48d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_d5c48d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl index 3bb75acfd8..980b696146 100644 --- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_d5c48d() { float4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_d5c48d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm index 194a0dca80..a1ae055572 100644 --- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_d5c48d "textureLoad_d5c48d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_d5c48d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_d5c48d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_d5c48d - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_d5c48d + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_d5c48d + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_d5c48d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_d5c48d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl index 111f88a5da..d795c88a4e 100644 --- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_d5c48d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_d5c48d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl index c59a55a2fd..ae7b2b58da 100644 --- a/test/intrinsics/gen/textureLoad/d81c57.wgsl +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl @@ -28,8 +28,9 @@ fn textureLoad_d81c57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_d81c57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl index 3c88ef980a..0e463d6037 100644 --- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_d81c57() { float4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_d81c57(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm index a0a3217ad8..b81e75f9ca 100644 --- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_d81c57 "textureLoad_d81c57" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_d81c57 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %int_1 - OpStore %res %12 +%textureLoad_d81c57 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_d81c57 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_d81c57 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_d81c57 + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_d81c57 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_d81c57 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl index ef9b797212..c0148386d8 100644 --- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_d81c57() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_d81c57(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl index 7a14592478..ae08838491 100644 --- a/test/intrinsics/gen/textureLoad/d8617f.wgsl +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl @@ -28,8 +28,9 @@ fn textureLoad_d8617f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_d8617f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl index 2f96813baf..8dcb976343 100644 --- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_d8617f() { int4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_d8617f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm index c478e6565a..42c7ef1737 100644 --- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_d8617f "textureLoad_d8617f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,37 +34,49 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %22 = OpConstantNull %v4int + %26 = OpConstantNull %v4int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_d8617f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %19 - OpStore %res %13 +%textureLoad_d8617f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %23 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_d8617f + %34 = OpFunctionCall %void %textureLoad_d8617f + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_d8617f +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_d8617f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_d8617f +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_d8617f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl index 7a9f7a3ca9..892d0257be 100644 --- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_d8617f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_d8617f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl index d14f010084..dd0da2889b 100644 --- a/test/intrinsics/gen/textureLoad/dbd554.wgsl +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl @@ -28,8 +28,9 @@ fn textureLoad_dbd554() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_dbd554(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl index 8cbc99e1b0..9d0223f14b 100644 --- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_dbd554() { int4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_dbd554(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm index 384a41ede0..c92fb06e24 100644 --- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_dbd554 "textureLoad_dbd554" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_dbd554 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_dbd554 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_dbd554 + %32 = OpFunctionCall %void %textureLoad_dbd554 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_dbd554 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_dbd554 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_dbd554 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_dbd554 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl index 2e967b48a3..3cbc34f8d2 100644 --- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_dbd554() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_dbd554(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl index 282486b0ea..229e692b08 100644 --- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl @@ -28,8 +28,9 @@ fn textureLoad_ddeed3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_ddeed3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl index dc13a6ac5f..d3fb264571 100644 --- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_ddeed3() { int4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_ddeed3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm index f64fd4b334..70a68946a2 100644 --- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_ddeed3 "textureLoad_ddeed3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %19 = OpConstantNull %v4int + %23 = OpConstantNull %v4int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_ddeed3 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %int_1 - OpStore %res %13 +%textureLoad_ddeed3 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_ddeed3 + %31 = OpFunctionCall %void %textureLoad_ddeed3 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_ddeed3 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_ddeed3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_ddeed3 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_ddeed3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl index 90301b7be7..c5757d2562 100644 --- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_ddeed3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_ddeed3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl index 28cb9dcc0a..e9c7f72941 100644 --- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl @@ -28,8 +28,9 @@ fn textureLoad_dee8e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_dee8e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl index f11845c988..aa4d7871aa 100644 --- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_dee8e7() { int4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_dee8e7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm index 35d8476cc9..913ff162ed 100644 --- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_dee8e7 "textureLoad_dee8e7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_dee8e7 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_dee8e7 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_dee8e7 + %32 = OpFunctionCall %void %textureLoad_dee8e7 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_dee8e7 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_dee8e7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_dee8e7 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_dee8e7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl index 9d7c3f935c..c21dfb702c 100644 --- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_dee8e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_dee8e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl index 5323c08f1d..648d0ba618 100644 --- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl @@ -28,8 +28,9 @@ fn textureLoad_e3d2cc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_e3d2cc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl index 724f8139dd..3861e2e979 100644 --- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureLoad_e3d2cc() { int4 res = arg_0.Load(int3(0, 0, 0), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_e3d2cc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm index c3ba65e067..c51e9592ef 100644 --- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm @@ -1,25 +1,29 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_e3d2cc "textureLoad_e3d2cc" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,48 @@ %7 = OpTypeImage %int 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %21 = OpConstantNull %v4int + %25 = OpConstantNull %v4int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_e3d2cc = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageFetch %v4int %15 %17 Sample %int_1 - OpStore %res %13 +%textureLoad_e3d2cc = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageFetch %v4int %19 %21 Sample %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_e3d2cc + %33 = OpFunctionCall %void %textureLoad_e3d2cc + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_e3d2cc +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_e3d2cc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_e3d2cc +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_e3d2cc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl index eccdf9b8fa..decb417ae3 100644 --- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_e3d2cc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_e3d2cc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl index c5cd6f4dba..95166c3588 100644 --- a/test/intrinsics/gen/textureLoad/e65916.wgsl +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl @@ -28,8 +28,9 @@ fn textureLoad_e65916() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_e65916(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl index 1184561fc0..9cd3006d64 100644 --- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_e65916() { int4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_e65916(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm index c46e235186..cb68194724 100644 --- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_e65916 "textureLoad_e65916" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_e65916 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_e65916 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_e65916 + %32 = OpFunctionCall %void %textureLoad_e65916 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_e65916 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_e65916 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_e65916 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_e65916 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl index f3f6648fe8..33db37a742 100644 --- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_e65916() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_e65916(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl index 7774adef20..8ceb8c16cd 100644 --- a/test/intrinsics/gen/textureLoad/e893d7.wgsl +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl @@ -28,8 +28,9 @@ fn textureLoad_e893d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_e893d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl index d3f874e4a3..c14dc82525 100644 --- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_e893d7() { float4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_e893d7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm index 3268cd207c..55cf3f99c2 100644 --- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_e893d7 "textureLoad_e893d7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_e893d7 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_e893d7 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_e893d7 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_e893d7 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_e893d7 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_e893d7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_e893d7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl index 4cb54fa149..48373a584e 100644 --- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_e893d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_e893d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl index 895a08dd27..38d4ce4436 100644 --- a/test/intrinsics/gen/textureLoad/eb573b.wgsl +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl @@ -28,8 +28,9 @@ fn textureLoad_eb573b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_eb573b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl index a4fc90a7b7..c1468f712e 100644 --- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_eb573b() { int4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_eb573b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm index fbebdb8578..44212e5097 100644 --- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_eb573b "textureLoad_eb573b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 2D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %_ptr_Function_v4int = OpTypePointer Function %v4int - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_eb573b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %20 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %17 - OpStore %res %13 +%textureLoad_eb573b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %24 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %21 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_eb573b + %32 = OpFunctionCall %void %textureLoad_eb573b + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_eb573b +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_eb573b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_eb573b +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_eb573b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl index 9b8ee432a5..11af36ee94 100644 --- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_eb573b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_eb573b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl index 5ee1d3d96e..744ad3bb40 100644 --- a/test/intrinsics/gen/textureLoad/ecc823.wgsl +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl @@ -28,8 +28,9 @@ fn textureLoad_ecc823() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_ecc823(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl index 7a7b63c347..b43c88d466 100644 --- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureLoad_ecc823() { uint4 res = arg_0.Load(int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_ecc823(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm index 19b1a05847..75c412addc 100644 --- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_ecc823 "textureLoad_ecc823" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %18 = OpConstantNull %v2int + %22 = OpConstantNull %v2int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_ecc823 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_ecc823 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_ecc823 + %33 = OpFunctionCall %void %textureLoad_ecc823 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_ecc823 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_ecc823 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_ecc823 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_ecc823 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl index 9a6a7886f4..3e5e549b1d 100644 --- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_ecc823() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_ecc823(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl index 8273c31f28..3561c84b54 100644 --- a/test/intrinsics/gen/textureLoad/ef5405.wgsl +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl @@ -28,8 +28,9 @@ fn textureLoad_ef5405() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_ef5405(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl index e36270c27a..865105ee3c 100644 --- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_ef5405() { uint4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_ef5405(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm index e14736cbc6..35c2672b04 100644 --- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_ef5405 "textureLoad_ef5405" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_ef5405 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_ef5405 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_ef5405 + %33 = OpFunctionCall %void %textureLoad_ef5405 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_ef5405 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_ef5405 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_ef5405 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_ef5405 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl index 3a9ed2819a..68c90ba66c 100644 --- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_ef5405() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_ef5405(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl index 72c83bbb82..2707fbf054 100644 --- a/test/intrinsics/gen/textureLoad/f06b69.wgsl +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl @@ -28,8 +28,9 @@ fn textureLoad_f06b69() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f06b69(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl index 981779d335..a74f63d8a2 100644 --- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_f06b69() { int4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_f06b69(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm index 73941813e7..c51dbefa28 100644 --- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_f06b69 "textureLoad_f06b69" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 1D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %int_1 = OpConstant %int 1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %19 = OpConstantNull %v4int + %23 = OpConstantNull %v4int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_f06b69 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %19 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %int_1 - OpStore %res %13 +%textureLoad_f06b69 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %int_1 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_f06b69 + %31 = OpFunctionCall %void %textureLoad_f06b69 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_f06b69 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureLoad_f06b69 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_f06b69 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_f06b69 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl index aa69f056bc..c20a1cd153 100644 --- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_f06b69() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f06b69(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl index eccd87f291..6f6e2bb03d 100644 --- a/test/intrinsics/gen/textureLoad/f379e2.wgsl +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl @@ -28,8 +28,9 @@ fn textureLoad_f379e2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f379e2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl index de2e3ed488..b9cef99dc9 100644 --- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_f379e2() { float4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_f379e2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm index 903570cf24..5261954051 100644 --- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_f379e2 "textureLoad_f379e2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,38 +32,48 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %22 = OpConstantNull %v4float + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_f379e2 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %22 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %19 - OpStore %res %12 +%textureLoad_f379e2 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %22 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %24 = OpLabel - OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_f379e2 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_f379e2 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %31 = OpLabel +%vertex_main = OpFunction %void None %12 + %30 = OpLabel + OpStore %tint_pointsize %float_1 %32 = OpFunctionCall %void %textureLoad_f379e2 + %33 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_f379e2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_f379e2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl index ac8b4b3540..a5546237ea 100644 --- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_f379e2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f379e2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl index 17a36542da..8931760664 100644 --- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl @@ -28,8 +28,9 @@ fn textureLoad_f56e6f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f56e6f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl index 866fd9d07e..4824067781 100644 --- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_f56e6f() { uint4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_f56e6f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm index 882c01ea77..22cb292954 100644 --- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_f56e6f "textureLoad_f56e6f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %18 = OpConstantNull %v3int + %22 = OpConstantNull %v3int %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_f56e6f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %21 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %18 - OpStore %res %13 +%textureLoad_f56e6f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %25 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %22 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureLoad_f56e6f + %33 = OpFunctionCall %void %textureLoad_f56e6f + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureLoad_f56e6f +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_f56e6f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureLoad_f56e6f +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureLoad_f56e6f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl index c6ee7db773..394ca11fdf 100644 --- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_f56e6f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f56e6f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl index 37f1354a4d..76e287e1cc 100644 --- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl @@ -28,8 +28,9 @@ fn textureLoad_f74bd8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f74bd8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl index 2745df646e..786fc1a402 100644 --- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_f74bd8() { float4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_f74bd8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm index 1713cb85c1..2c1f11503f 100644 --- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_f74bd8 "textureLoad_f74bd8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_f74bd8 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_f74bd8 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_f74bd8 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_f74bd8 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_f74bd8 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_f74bd8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_f74bd8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl index 91cf3018bb..5402217970 100644 --- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_f74bd8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_f74bd8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl index 48ae1d7d7c..9fc35a4ef3 100644 --- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl @@ -28,8 +28,9 @@ fn textureLoad_fc6d36() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_fc6d36(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl index b35937a136..a25f805a02 100644 --- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_fc6d36() { int4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_fc6d36(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm index 7f42977219..6165d011e9 100644 --- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 33 +; Bound: 42 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_fc6d36 "textureLoad_fc6d36" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,37 +33,49 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4int = OpTypeVector %int 4 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4int = OpTypePointer Function %v4int - %22 = OpConstantNull %v4int + %26 = OpConstantNull %v4int + %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_fc6d36 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4int Function %22 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4int %15 %19 - OpStore %res %13 +%textureLoad_fc6d36 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %26 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4int %19 %23 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %24 = OpLabel +%tint_symbol_2 = OpFunction %void None %27 +%tint_symbol = OpFunctionParameter %v4float + %30 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %32 = OpLabel OpStore %tint_pointsize %float_1 - %26 = OpFunctionCall %void %textureLoad_fc6d36 + %34 = OpFunctionCall %void %textureLoad_fc6d36 + %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureLoad_fc6d36 +%fragment_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureLoad_fc6d36 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %31 = OpLabel - %32 = OpFunctionCall %void %textureLoad_fc6d36 +%compute_main = OpFunction %void None %13 + %40 = OpLabel + %41 = OpFunctionCall %void %textureLoad_fc6d36 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl index c08523c024..6ab0bc3942 100644 --- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_fc6d36() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_fc6d36(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl index 5a977acc5e..b7e25d6859 100644 --- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl @@ -28,8 +28,9 @@ fn textureLoad_fdebd0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_fdebd0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl index e1ddccacef..827c69a856 100644 --- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureLoad_fdebd0() { uint4 res = arg_0.Load(int4(0, 0, 1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_fdebd0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm index e773e58d56..5c8c83f8ff 100644 --- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 34 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_fdebd0 "textureLoad_fdebd0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,38 +33,50 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v4uint = OpTypeVector %uint 4 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %_ptr_Function_v4uint = OpTypePointer Function %v4uint - %23 = OpConstantNull %v4uint + %27 = OpConstantNull %v4uint + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_fdebd0 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_v4uint Function %23 - %15 = OpLoad %7 %arg_0 - %13 = OpImageRead %v4uint %15 %20 - OpStore %res %13 +%textureLoad_fdebd0 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %27 + %19 = OpLoad %7 %arg_0 + %17 = OpImageRead %v4uint %19 %24 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %25 = OpLabel +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float + %31 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %33 = OpLabel OpStore %tint_pointsize %float_1 - %27 = OpFunctionCall %void %textureLoad_fdebd0 + %35 = OpFunctionCall %void %textureLoad_fdebd0 + %36 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureLoad_fdebd0 +%fragment_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureLoad_fdebd0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %32 = OpLabel - %33 = OpFunctionCall %void %textureLoad_fdebd0 +%compute_main = OpFunction %void None %13 + %41 = OpLabel + %42 = OpFunctionCall %void %textureLoad_fdebd0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl index 89933737eb..1e9118c268 100644 --- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_fdebd0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_fdebd0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl index 0f8f96024a..1683f24d04 100644 --- a/test/intrinsics/gen/textureLoad/fe222a.wgsl +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl @@ -28,8 +28,9 @@ fn textureLoad_fe222a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_fe222a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl index bb2a0b03e2..79bb239524 100644 --- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture1D arg_0 : register(t0, space1); void textureLoad_fe222a() { float4 res = arg_0.Load(int2(1, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_fe222a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm index 7ef1da7907..e9b82b35d9 100644 --- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_fe222a "textureLoad_fe222a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,45 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %19 = OpConstantNull %v4float + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_fe222a = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %19 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %int_1 - OpStore %res %12 +%textureLoad_fe222a = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %int_1 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel - OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureLoad_fe222a - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float %25 = OpLabel - %26 = OpFunctionCall %void %textureLoad_fe222a + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel +%vertex_main = OpFunction %void None %12 + %27 = OpLabel + OpStore %tint_pointsize %float_1 %29 = OpFunctionCall %void %textureLoad_fe222a + %30 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureLoad_fe222a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureLoad_fe222a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl index f6ac8774c3..5f27e75206 100644 --- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_fe222a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_fe222a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl index 8f36ccb6f3..83a15a7469 100644 --- a/test/intrinsics/gen/textureLoad/feab99.wgsl +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl @@ -28,8 +28,9 @@ fn textureLoad_feab99() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_feab99(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl index 03c7b20e73..faa62022e8 100644 --- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureLoad_feab99() { float4 res = arg_0.Load(int4(0, 0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureLoad_feab99(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm index 31c2a72cac..f0af0c09a8 100644 --- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureLoad_feab99 "textureLoad_feab99" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,46 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %void = OpTypeVoid - %8 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %void = OpTypeVoid + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %20 = OpConstantNull %v4float + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureLoad_feab99 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %20 - %14 = OpLoad %7 %arg_0 - %12 = OpImageRead %v4float %14 %17 - OpStore %res %12 +%textureLoad_feab99 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %17 = OpLoad %7 %arg_0 + %16 = OpImageRead %v4float %17 %20 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureLoad_feab99 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureLoad_feab99 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureLoad_feab99 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureLoad_feab99 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureLoad_feab99 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl index c0de2b4f74..cb8f4b6007 100644 --- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureLoad_feab99() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureLoad_feab99(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl index fa64259f2c..3f91929661 100644 --- a/test/intrinsics/gen/textureNumLayers/024820.wgsl +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_024820() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_024820(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl index 066e3c378b..f6361b4075 100644 --- a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_024820() { @@ -6,9 +10,10 @@ void textureNumLayers_024820() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_024820(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm index a5b63d2033..45ba7e69dd 100644 --- a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_024820 "textureNumLayers_024820" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,48 @@ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_024820 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySizeLod %v3int %16 %int_0 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_024820 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySizeLod %v3int %20 %int_0 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_024820 + %32 = OpFunctionCall %void %textureNumLayers_024820 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_024820 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_024820 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_024820 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_024820 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl index 923f42ddce..51a0dafec6 100644 --- a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_024820() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_024820(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl index a8e1565da6..6f9c2e2acd 100644 --- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_053df7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_053df7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl index 5d43efdd79..22ac339fd7 100644 --- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLayers_053df7() { @@ -6,9 +10,10 @@ void textureNumLayers_053df7() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_053df7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm index 405ee4a6aa..9dcf75f6a0 100644 --- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_053df7 "textureNumLayers_053df7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,36 +34,48 @@ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %21 = OpConstantNull %int + %25 = OpConstantNull %int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_053df7 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_0 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_053df7 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureNumLayers_053df7 + %33 = OpFunctionCall %void %textureNumLayers_053df7 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLayers_053df7 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLayers_053df7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureNumLayers_053df7 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureNumLayers_053df7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl index 2ff71e2910..b890752e27 100644 --- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_053df7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_053df7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl index c3530b1eb1..e7303032fa 100644 --- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_058cc3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_058cc3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl index bea559a1dd..5f555312c3 100644 --- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_058cc3() { @@ -6,9 +10,10 @@ void textureNumLayers_058cc3() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_058cc3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm index 987181302f..c6295ab031 100644 --- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_058cc3 "textureNumLayers_058cc3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_058cc3 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_058cc3 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_058cc3 + %31 = OpFunctionCall %void %textureNumLayers_058cc3 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_058cc3 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_058cc3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_058cc3 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_058cc3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl index 9ca42303f0..1a2a38d34f 100644 --- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_058cc3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_058cc3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl index 7522096066..7b272c6ede 100644 --- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_09d05d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_09d05d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl index 8b0879e7e3..653d721ee6 100644 --- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_09d05d() { @@ -6,9 +10,10 @@ void textureNumLayers_09d05d() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_09d05d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm index 6bbf3f537d..875a32db54 100644 --- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_09d05d "textureNumLayers_09d05d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_09d05d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_09d05d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_09d05d + %31 = OpFunctionCall %void %textureNumLayers_09d05d + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_09d05d +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_09d05d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_09d05d +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_09d05d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl index 16aa0f2685..5235e46b9d 100644 --- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_09d05d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_09d05d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl index 33f4131965..b7d78e4824 100644 --- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_13b4ce() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_13b4ce(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl index a363038680..bd389a5d7b 100644 --- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_13b4ce() { @@ -6,9 +10,10 @@ void textureNumLayers_13b4ce() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_13b4ce(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm index 0c5d315e36..b718fb6570 100644 --- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_13b4ce "textureNumLayers_13b4ce" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_13b4ce = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_13b4ce = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_13b4ce + %31 = OpFunctionCall %void %textureNumLayers_13b4ce + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_13b4ce +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_13b4ce OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_13b4ce +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_13b4ce OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl index f6dfe9fb87..783081fa35 100644 --- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_13b4ce() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_13b4ce(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl index 568367ecd0..91c44719ba 100644 --- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_22e53b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_22e53b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl index 1d275f4671..bf761c325c 100644 --- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_22e53b() { @@ -6,9 +10,10 @@ void textureNumLayers_22e53b() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_22e53b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm index 162d072c34..8cb1c31d57 100644 --- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_22e53b "textureNumLayers_22e53b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_22e53b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_22e53b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_22e53b + %31 = OpFunctionCall %void %textureNumLayers_22e53b + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_22e53b +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_22e53b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_22e53b +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_22e53b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl index 8e51176e39..4932ed6efb 100644 --- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_22e53b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_22e53b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl index d0ac8df83e..47ccd6837d 100644 --- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_2f6bb3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_2f6bb3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl index b4f57801ee..4ca6059925 100644 --- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_2f6bb3() { @@ -6,9 +10,10 @@ void textureNumLayers_2f6bb3() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_2f6bb3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm index deb036d997..397d281fa6 100644 --- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_2f6bb3 "textureNumLayers_2f6bb3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_2f6bb3 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_2f6bb3 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_2f6bb3 + %32 = OpFunctionCall %void %textureNumLayers_2f6bb3 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_2f6bb3 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_2f6bb3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_2f6bb3 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_2f6bb3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl index 841cafc0eb..105f35fc33 100644 --- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_2f6bb3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_2f6bb3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl index 1cd07fd163..fe36fe8118 100644 --- a/test/intrinsics/gen/textureNumLayers/315298.wgsl +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_315298() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_315298(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl index 637db425be..effba23fb7 100644 --- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_315298() { @@ -6,9 +10,10 @@ void textureNumLayers_315298() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_315298(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm index 3ff059ad13..7ec4325dcd 100644 --- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_315298 "textureNumLayers_315298" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_315298 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_315298 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_315298 + %31 = OpFunctionCall %void %textureNumLayers_315298 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_315298 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_315298 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_315298 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_315298 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl index 5f0a525385..6cf6c73457 100644 --- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_315298() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_315298(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl index 2dd6eaada8..52e4111ed9 100644 --- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_3615e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_3615e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl index acb2945280..22456f55d1 100644 --- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_3615e3() { @@ -6,9 +10,10 @@ void textureNumLayers_3615e3() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_3615e3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm index ecc75eff2e..b3125c43a7 100644 --- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_3615e3 "textureNumLayers_3615e3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_3615e3 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_3615e3 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_3615e3 + %31 = OpFunctionCall %void %textureNumLayers_3615e3 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_3615e3 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_3615e3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_3615e3 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_3615e3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl index f248320e8a..42d36f29ce 100644 --- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_3615e3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_3615e3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl index 044fa9927b..ba10380f42 100644 --- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_390fd5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_390fd5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl index 9ab80c5ba1..ea1bd831f4 100644 --- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_390fd5() { @@ -6,9 +10,10 @@ void textureNumLayers_390fd5() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_390fd5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm index cd442f82e9..bbe77b318a 100644 --- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_390fd5 "textureNumLayers_390fd5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_390fd5 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_390fd5 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_390fd5 + %32 = OpFunctionCall %void %textureNumLayers_390fd5 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_390fd5 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_390fd5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_390fd5 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_390fd5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl index 91b250e633..1d83dcc0a2 100644 --- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_390fd5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_390fd5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl index ab2be8b37b..57f8b7b422 100644 --- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_45155d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_45155d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl index ba95843802..48a7c2592a 100644 --- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_45155d() { @@ -6,9 +10,10 @@ void textureNumLayers_45155d() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_45155d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm index dde6292274..6d2daac9f4 100644 --- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_45155d "textureNumLayers_45155d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_45155d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_45155d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_45155d + %31 = OpFunctionCall %void %textureNumLayers_45155d + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_45155d +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_45155d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_45155d +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_45155d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl index 107a74cadb..756cf9fdd4 100644 --- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_45155d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_45155d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl index 45bf5f8e8a..61ea6928fe 100644 --- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_4bf67b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_4bf67b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl index 629aa521b5..40be9f85c8 100644 --- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_4bf67b() { @@ -6,9 +10,10 @@ void textureNumLayers_4bf67b() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_4bf67b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm index 12bd4772e9..4ccb26931b 100644 --- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_4bf67b "textureNumLayers_4bf67b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_4bf67b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_4bf67b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_4bf67b + %31 = OpFunctionCall %void %textureNumLayers_4bf67b + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_4bf67b +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_4bf67b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_4bf67b +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_4bf67b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl index 2185d738d7..f3c2619851 100644 --- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_4bf67b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_4bf67b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl index 3215988968..7dc062aa28 100644 --- a/test/intrinsics/gen/textureNumLayers/562013.wgsl +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_562013() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_562013(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl index 273ab51b7a..beecae2bce 100644 --- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_562013() { @@ -6,9 +10,10 @@ void textureNumLayers_562013() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_562013(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm index 2f25a38960..4dd95b27a8 100644 --- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_562013 "textureNumLayers_562013" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_562013 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_562013 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_562013 + %31 = OpFunctionCall %void %textureNumLayers_562013 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_562013 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_562013 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_562013 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_562013 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl index 5a217b6265..c2c48bd90e 100644 --- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_562013() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_562013(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl index f752ba078b..46828ea81d 100644 --- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_57092f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_57092f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl index e50de13993..fa6c025ade 100644 --- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_57092f() { @@ -6,9 +10,10 @@ void textureNumLayers_57092f() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_57092f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm index fdfa698e32..11e5d4ad8d 100644 --- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_57092f "textureNumLayers_57092f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_57092f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_57092f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_57092f + %32 = OpFunctionCall %void %textureNumLayers_57092f + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_57092f +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_57092f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_57092f +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_57092f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl index eb7bac54e7..b7f2f1805e 100644 --- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_57092f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_57092f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl index a53d9ee919..a1b97e1e09 100644 --- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_5d59cd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_5d59cd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl index 86b51cbb96..ee91b15e20 100644 --- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLayers_5d59cd() { @@ -6,9 +10,10 @@ void textureNumLayers_5d59cd() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_5d59cd(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm index 3dc3190bfb..dee75ea666 100644 --- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_5d59cd "textureNumLayers_5d59cd" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_5d59cd = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySizeLod %v3int %16 %int_0 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_5d59cd = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySizeLod %v3int %20 %int_0 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_5d59cd + %32 = OpFunctionCall %void %textureNumLayers_5d59cd + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_5d59cd +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_5d59cd OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_5d59cd +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_5d59cd OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl index 6d6fd6c71f..8da9f1490c 100644 --- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_5d59cd() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_5d59cd(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl index 82ac2b3201..fcac6c4b09 100644 --- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_68a65b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_68a65b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl index edfd0728cf..b68554272f 100644 --- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_68a65b() { @@ -6,9 +10,10 @@ void textureNumLayers_68a65b() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_68a65b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm index 164344890b..f31077fb7a 100644 --- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_68a65b "textureNumLayers_68a65b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_68a65b = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_68a65b = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_68a65b + %31 = OpFunctionCall %void %textureNumLayers_68a65b + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_68a65b +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_68a65b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_68a65b +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_68a65b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl index 5b331c24e0..606e2b04fa 100644 --- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_68a65b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_68a65b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl index 54b06152d8..1edd06a8f3 100644 --- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_778bd1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_778bd1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl index 4bbc51cda8..e93accf475 100644 --- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLayers_778bd1() { @@ -6,9 +10,10 @@ void textureNumLayers_778bd1() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_778bd1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm index 8c5776800c..ab55f072d4 100644 --- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_778bd1 "textureNumLayers_778bd1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_778bd1 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySizeLod %v3int %16 %int_0 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_778bd1 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySizeLod %v3int %20 %int_0 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_778bd1 + %32 = OpFunctionCall %void %textureNumLayers_778bd1 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_778bd1 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_778bd1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_778bd1 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_778bd1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl index 43e7c188c8..7f5a1c254e 100644 --- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_778bd1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_778bd1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl index 846381a05f..8aaf85199d 100644 --- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_7f1937() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_7f1937(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl index 2017e6e695..537a9c68cc 100644 --- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_7f1937() { @@ -6,9 +10,10 @@ void textureNumLayers_7f1937() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_7f1937(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm index d20fcb0e1a..8789a55ac4 100644 --- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_7f1937 "textureNumLayers_7f1937" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_7f1937 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_7f1937 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_7f1937 + %31 = OpFunctionCall %void %textureNumLayers_7f1937 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_7f1937 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_7f1937 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_7f1937 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_7f1937 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl index ffec0d1c61..4378023779 100644 --- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_7f1937() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_7f1937(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl index 665ad712bc..ae6dc7a669 100644 --- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_85f980() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_85f980(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl index c0aa9c7509..32e8d54038 100644 --- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLayers_85f980() { @@ -6,9 +10,10 @@ void textureNumLayers_85f980() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_85f980(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm index f9ce61fa22..18ef1fc394 100644 --- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_85f980 "textureNumLayers_85f980" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_85f980 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySizeLod %v3int %16 %int_0 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_85f980 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySizeLod %v3int %20 %int_0 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_85f980 + %32 = OpFunctionCall %void %textureNumLayers_85f980 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_85f980 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_85f980 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_85f980 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_85f980 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl index b076871cb7..199d4cad36 100644 --- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_85f980() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_85f980(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl index 0e8fbe7e0a..c12d10f6d6 100644 --- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_87953e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_87953e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl index 96d638fe32..585cae7737 100644 --- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_87953e() { @@ -6,9 +10,10 @@ void textureNumLayers_87953e() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_87953e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm index 8671f4ade5..053b87ca96 100644 --- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_87953e "textureNumLayers_87953e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,36 +33,48 @@ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %21 = OpConstantNull %int + %25 = OpConstantNull %int + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_87953e = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %21 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySizeLod %v3int %17 %int_0 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_87953e = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %25 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureNumLayers_87953e + %33 = OpFunctionCall %void %textureNumLayers_87953e + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLayers_87953e +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLayers_87953e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureNumLayers_87953e +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureNumLayers_87953e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl index cfd9b954bd..3ebba1a9cd 100644 --- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_87953e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_87953e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl index 423f9c8070..0550578301 100644 --- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_893e7c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_893e7c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl index 507cb89fb1..09cee4cd3a 100644 --- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_893e7c() { @@ -6,9 +10,10 @@ void textureNumLayers_893e7c() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_893e7c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm index 445ed71d58..898ee2c824 100644 --- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_893e7c "textureNumLayers_893e7c" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_893e7c = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySizeLod %v3int %16 %int_0 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_893e7c = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySizeLod %v3int %20 %int_0 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_893e7c + %32 = OpFunctionCall %void %textureNumLayers_893e7c + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_893e7c +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_893e7c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_893e7c +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_893e7c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl index eb3bf2f0da..951867a04e 100644 --- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_893e7c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_893e7c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl index 22adab5fbf..f77d0119a4 100644 --- a/test/intrinsics/gen/textureNumLayers/938763.wgsl +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_938763() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_938763(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl index 47da08ae2a..1e411b31e3 100644 --- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_938763() { @@ -6,9 +10,10 @@ void textureNumLayers_938763() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_938763(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm index 7fcf149a63..7a8a0ea6b2 100644 --- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_938763 "textureNumLayers_938763" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,35 +35,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_938763 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_938763 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_938763 + %32 = OpFunctionCall %void %textureNumLayers_938763 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_938763 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_938763 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_938763 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_938763 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl index c7a5abca70..b898ee9edc 100644 --- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_938763() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_938763(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl index 26d33d50e3..2d3039308e 100644 --- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_9700fb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_9700fb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl index d08ca80ac1..9c347489a6 100644 --- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_9700fb() { @@ -6,9 +10,10 @@ void textureNumLayers_9700fb() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_9700fb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm index 76f48e32d5..24e0ac5585 100644 --- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_9700fb "textureNumLayers_9700fb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_9700fb = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_9700fb = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_9700fb + %32 = OpFunctionCall %void %textureNumLayers_9700fb + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_9700fb +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_9700fb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_9700fb +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_9700fb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl index b63c56deea..09a5873523 100644 --- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_9700fb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_9700fb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl index c3967a492b..8868b3f9a5 100644 --- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_a216d2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_a216d2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl index 749335c377..0d1373ee1e 100644 --- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_a216d2() { @@ -6,9 +10,10 @@ void textureNumLayers_a216d2() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_a216d2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm index 092addb493..36439d21b6 100644 --- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_a216d2 "textureNumLayers_a216d2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_a216d2 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_a216d2 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_a216d2 + %31 = OpFunctionCall %void %textureNumLayers_a216d2 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_a216d2 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_a216d2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_a216d2 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_a216d2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl index 1f18aa063b..595c790cee 100644 --- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_a216d2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_a216d2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl index 5fd1c968da..39c9586654 100644 --- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_aa08a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_aa08a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl index 4c10784bbb..8290a5f8a2 100644 --- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_aa08a7() { @@ -6,9 +10,10 @@ void textureNumLayers_aa08a7() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_aa08a7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm index 499db639ac..e282d0ca13 100644 --- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_aa08a7 "textureNumLayers_aa08a7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_aa08a7 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_aa08a7 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_aa08a7 + %31 = OpFunctionCall %void %textureNumLayers_aa08a7 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_aa08a7 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_aa08a7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_aa08a7 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_aa08a7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl index 82ed03cb26..37ada319b7 100644 --- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_aa08a7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_aa08a7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl index b0897169cf..1bc7e47b85 100644 --- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_ab0c9b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_ab0c9b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl index c5887d5e1e..a2d074186d 100644 --- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_ab0c9b() { @@ -6,9 +10,10 @@ void textureNumLayers_ab0c9b() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_ab0c9b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm index 5e486fdd73..296cafd8d7 100644 --- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_ab0c9b "textureNumLayers_ab0c9b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,34 +35,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_ab0c9b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_ab0c9b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_ab0c9b + %31 = OpFunctionCall %void %textureNumLayers_ab0c9b + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_ab0c9b +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_ab0c9b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_ab0c9b +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_ab0c9b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl index 1d19a4214b..86e0e6a370 100644 --- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_ab0c9b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_ab0c9b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl index ea807196d1..7b3ec57052 100644 --- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_b8cd76() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_b8cd76(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl index 0e8a101203..5536f902bd 100644 --- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_b8cd76() { @@ -6,9 +10,10 @@ void textureNumLayers_b8cd76() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_b8cd76(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm index 109c12e5b6..553f04132c 100644 --- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_b8cd76 "textureNumLayers_b8cd76" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_b8cd76 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_b8cd76 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_b8cd76 + %31 = OpFunctionCall %void %textureNumLayers_b8cd76 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_b8cd76 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_b8cd76 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_b8cd76 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_b8cd76 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl index c769c1efb3..e06a165421 100644 --- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_b8cd76() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_b8cd76(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl index 0bed34bdf1..f6b5a6dc69 100644 --- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_be1d70() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_be1d70(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl index a29e8bc2e1..d46a506f64 100644 --- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_be1d70() { @@ -6,9 +10,10 @@ void textureNumLayers_be1d70() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_be1d70(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm index cbe7eff857..591fbc2d48 100644 --- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_be1d70 "textureNumLayers_be1d70" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_be1d70 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_be1d70 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_be1d70 + %31 = OpFunctionCall %void %textureNumLayers_be1d70 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_be1d70 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_be1d70 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_be1d70 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_be1d70 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl index 3474b240fc..6e4fd3a6e6 100644 --- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_be1d70() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_be1d70(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl index b10c46456d..fcdcdad5e7 100644 --- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_be3acb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_be3acb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl index fe927b34ba..b4c71f98a8 100644 --- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_be3acb() { @@ -6,9 +10,10 @@ void textureNumLayers_be3acb() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_be3acb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm index 9f51dbd2e9..c3bc5c4138 100644 --- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_be3acb "textureNumLayers_be3acb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_be3acb = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_be3acb = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_be3acb + %31 = OpFunctionCall %void %textureNumLayers_be3acb + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_be3acb +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_be3acb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_be3acb +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_be3acb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl index 1d18e594ba..d986afd5ec 100644 --- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_be3acb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_be3acb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl index 45daa99b02..ed3ff194c5 100644 --- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_c09917() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_c09917(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl index 5753eb4914..3f110af1c1 100644 --- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_c09917() { @@ -6,9 +10,10 @@ void textureNumLayers_c09917() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_c09917(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm index 98505af7d7..8238315eef 100644 --- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_c09917 "textureNumLayers_c09917" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_c09917 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_c09917 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_c09917 + %32 = OpFunctionCall %void %textureNumLayers_c09917 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_c09917 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_c09917 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_c09917 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_c09917 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl index bb20c2f01a..d57c7069f5 100644 --- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_c09917() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_c09917(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl index 248fbc90fe..e0dbae28fa 100644 --- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_c7c7f2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_c7c7f2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl index 4b597603b3..2043efa0d0 100644 --- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_c7c7f2() { @@ -6,9 +10,10 @@ void textureNumLayers_c7c7f2() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_c7c7f2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm index ed6686cc70..516bb385d9 100644 --- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_c7c7f2 "textureNumLayers_c7c7f2" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_c7c7f2 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_c7c7f2 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_c7c7f2 + %31 = OpFunctionCall %void %textureNumLayers_c7c7f2 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_c7c7f2 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_c7c7f2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_c7c7f2 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_c7c7f2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl index f4de08f414..781b87844d 100644 --- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_c7c7f2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_c7c7f2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl index 146b08dffc..a2ab9bb213 100644 --- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_cd5dc8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_cd5dc8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl index 4107f8c9e8..07fc309644 100644 --- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_cd5dc8() { @@ -6,9 +10,10 @@ void textureNumLayers_cd5dc8() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_cd5dc8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm index 29ca74bbd1..e084d973b3 100644 --- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_cd5dc8 "textureNumLayers_cd5dc8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_cd5dc8 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_cd5dc8 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_cd5dc8 + %32 = OpFunctionCall %void %textureNumLayers_cd5dc8 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_cd5dc8 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_cd5dc8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_cd5dc8 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_cd5dc8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl index bddc9ba1d7..b90de11503 100644 --- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_cd5dc8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_cd5dc8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl index 191034beb0..d41c52cc5a 100644 --- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_d5b228() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_d5b228(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl index 2dad2cebb9..ff73afa550 100644 --- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_d5b228() { @@ -6,9 +10,10 @@ void textureNumLayers_d5b228() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_d5b228(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm index dd55d2b3b4..090fad2459 100644 --- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_d5b228 "textureNumLayers_d5b228" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_d5b228 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_d5b228 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_d5b228 + %31 = OpFunctionCall %void %textureNumLayers_d5b228 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_d5b228 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_d5b228 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_d5b228 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_d5b228 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl index e5f7a25916..5aab279d61 100644 --- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_d5b228() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_d5b228(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl index 92e44777d6..c463fcf87e 100644 --- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_e15642() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_e15642(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl index 6615530b10..961f796489 100644 --- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_e15642() { @@ -6,9 +10,10 @@ void textureNumLayers_e15642() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_e15642(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm index 15c5d3b149..652d1e1f66 100644 --- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_e15642 "textureNumLayers_e15642" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonWritable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_e15642 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_e15642 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_e15642 + %31 = OpFunctionCall %void %textureNumLayers_e15642 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_e15642 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_e15642 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_e15642 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_e15642 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl index 4c1ec30b22..2545c669f8 100644 --- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_e15642() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_e15642(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl index 5564e7ab6c..a7cb687adc 100644 --- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_e31be1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_e31be1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl index 68850da0dd..f430c71215 100644 --- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_e31be1() { @@ -6,9 +10,10 @@ void textureNumLayers_e31be1() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_e31be1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm index 905e2ae80b..5ce6c9fead 100644 --- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_e31be1 "textureNumLayers_e31be1" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_e31be1 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_e31be1 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_e31be1 + %31 = OpFunctionCall %void %textureNumLayers_e31be1 + %32 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_e31be1 +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_e31be1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_e31be1 +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_e31be1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl index 910a278f74..bf169dd0b6 100644 --- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_e31be1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_e31be1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl index 831f136c85..a1c215d6ae 100644 --- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_e653c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_e653c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl index 5d592674fd..365d3f79c2 100644 --- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLayers_e653c0() { @@ -6,9 +10,10 @@ void textureNumLayers_e653c0() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_e653c0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm index a8ae9ae462..1502876dbe 100644 --- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_e653c0 "textureNumLayers_e653c0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,36 +32,48 @@ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_e653c0 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySizeLod %v3int %16 %int_0 - %12 = OpCompositeExtract %int %14 2 - OpStore %res %12 +%textureNumLayers_e653c0 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySizeLod %v3int %20 %int_0 + %16 = OpCompositeExtract %int %18 2 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_e653c0 + %32 = OpFunctionCall %void %textureNumLayers_e653c0 + %33 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_e653c0 +%fragment_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_e653c0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_e653c0 +%compute_main = OpFunction %void None %12 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_e653c0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl index f133adb16f..ec3a2760f1 100644 --- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_e653c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_e653c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl index 60e2445a33..d1b2dda548 100644 --- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_ee942f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_ee942f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl index 33663d4f34..5a051224f6 100644 --- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_ee942f() { @@ -6,9 +10,10 @@ void textureNumLayers_ee942f() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_ee942f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm index 773fc743a4..bd63c9d06b 100644 --- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_ee942f "textureNumLayers_ee942f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_ee942f = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_ee942f = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_ee942f + %32 = OpFunctionCall %void %textureNumLayers_ee942f + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_ee942f +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_ee942f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_ee942f +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_ee942f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl index 7874222093..2ba778e472 100644 --- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_ee942f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_ee942f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl index 96fc3e3da2..a3b91d0a75 100644 --- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_f33005() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_f33005(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl index 28dbfcb215..2c03b1b96b 100644 --- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_f33005() { @@ -6,9 +10,10 @@ void textureNumLayers_f33005() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_f33005(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm index 7237b6c498..46349d806f 100644 --- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_f33005 "textureNumLayers_f33005" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,34 +34,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %19 = OpConstantNull %int + %23 = OpConstantNull %int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_f33005 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %19 - %16 = OpLoad %7 %arg_0 - %14 = OpImageQuerySize %v3int %16 - %13 = OpCompositeExtract %int %14 2 - OpStore %res %13 +%textureNumLayers_f33005 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %23 + %20 = OpLoad %7 %arg_0 + %18 = OpImageQuerySize %v3int %20 + %17 = OpCompositeExtract %int %18 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureNumLayers_f33005 + %31 = OpFunctionCall %void %textureNumLayers_f33005 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureNumLayers_f33005 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureNumLayers_f33005 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureNumLayers_f33005 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureNumLayers_f33005 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl index 8211300a2c..2141b9cb81 100644 --- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_f33005() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_f33005(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl index 47277d1e5d..f9624cf6a1 100644 --- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_fcec98() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_fcec98(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl index 921abf0bf5..09ec6a49a7 100644 --- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_fcec98() { @@ -6,9 +10,10 @@ void textureNumLayers_fcec98() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_fcec98(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm index 8c8256e320..cf2b552dcd 100644 --- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm @@ -1,21 +1,24 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_fcec98 "textureNumLayers_fcec98" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -31,35 +35,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_fcec98 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_fcec98 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_fcec98 + %32 = OpFunctionCall %void %textureNumLayers_fcec98 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_fcec98 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_fcec98 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_fcec98 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_fcec98 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl index f3cdcf8483..d4c9e256f0 100644 --- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_fcec98() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_fcec98(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl index 077109c6c2..8bcbc36138 100644 --- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl @@ -28,8 +28,9 @@ fn textureNumLayers_ff5e89() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_ff5e89(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl index 52e8e30ac7..677e9f716e 100644 --- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureNumLayers_ff5e89() { @@ -6,9 +10,10 @@ void textureNumLayers_ff5e89() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLayers_ff5e89(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm index 43e4afa148..86089348e3 100644 --- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLayers_ff5e89 "textureNumLayers_ff5e89" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,35 +34,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %_ptr_Function_int = OpTypePointer Function %int - %20 = OpConstantNull %int + %24 = OpConstantNull %int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLayers_ff5e89 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %20 - %17 = OpLoad %7 %arg_0 - %15 = OpImageQuerySize %v3int %17 - %13 = OpCompositeExtract %int %15 2 - OpStore %res %13 +%textureNumLayers_ff5e89 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %24 + %21 = OpLoad %7 %arg_0 + %19 = OpImageQuerySize %v3int %21 + %17 = OpCompositeExtract %int %19 2 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureNumLayers_ff5e89 + %32 = OpFunctionCall %void %textureNumLayers_ff5e89 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLayers_ff5e89 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLayers_ff5e89 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureNumLayers_ff5e89 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureNumLayers_ff5e89 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl index dc726f5b9f..a5ddef8cb6 100644 --- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLayers_ff5e89() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLayers_ff5e89(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl index 2782726f0c..51879a883a 100644 --- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_076cb5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_076cb5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl index 035660115d..c70ebf903b 100644 --- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureNumLevels_076cb5() { @@ -6,9 +10,10 @@ void textureNumLevels_076cb5() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_076cb5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm index c4b65d111b..ab98b400a1 100644 --- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_076cb5 "textureNumLevels_076cb5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_076cb5 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_076cb5 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_076cb5 + %29 = OpFunctionCall %void %textureNumLevels_076cb5 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_076cb5 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_076cb5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_076cb5 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_076cb5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl index 42cfdbfe68..3fea2c8c59 100644 --- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_076cb5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_076cb5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl index 5f13a725fe..22da6865b4 100644 --- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_080d95() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_080d95(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl index bced17a33e..8faf945e7e 100644 --- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureNumLevels_080d95() { @@ -6,9 +10,10 @@ void textureNumLevels_080d95() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_080d95(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm index 76c0cb731d..63bb114d6e 100644 --- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_080d95 "textureNumLevels_080d95" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_080d95 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %14 - OpStore %res %13 +%textureNumLevels_080d95 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_080d95 + %29 = OpFunctionCall %void %textureNumLevels_080d95 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_080d95 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_080d95 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_080d95 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_080d95 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl index b3582761fe..653a894df7 100644 --- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_080d95() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_080d95(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl index 9f5c5ddf54..45f2fe9caa 100644 --- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_09ddd0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_09ddd0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl index ce4bd02d78..bc09a54f51 100644 --- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureNumLevels_09ddd0() { @@ -6,9 +10,10 @@ void textureNumLevels_09ddd0() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_09ddd0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm index 83b255f9ac..2f369dbdb3 100644 --- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_09ddd0 "textureNumLevels_09ddd0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_09ddd0 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %15 - OpStore %res %13 +%textureNumLevels_09ddd0 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureNumLevels_09ddd0 + %30 = OpFunctionCall %void %textureNumLevels_09ddd0 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureNumLevels_09ddd0 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureNumLevels_09ddd0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLevels_09ddd0 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLevels_09ddd0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl index 12ca9ff0d0..20b55f09cd 100644 --- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_09ddd0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_09ddd0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl index e03ec03cb1..25ffb94cde 100644 --- a/test/intrinsics/gen/textureNumLevels/105988.wgsl +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_105988() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_105988(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl index 5e0964440f..6e9874fbbf 100644 --- a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLevels_105988() { @@ -6,9 +10,10 @@ void textureNumLevels_105988() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_105988(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm index 3bf9719d94..7a3b6a8ac2 100644 --- a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_105988 "textureNumLevels_105988" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_105988 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_105988 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_105988 + %29 = OpFunctionCall %void %textureNumLevels_105988 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_105988 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_105988 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_105988 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_105988 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl index 60b58b2a01..8a3178d001 100644 --- a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_105988() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_105988(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl index 41cc9ebf05..004a8a4e3b 100644 --- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_23f750() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_23f750(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl index 54c42b182c..0787fa2099 100644 --- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureNumLevels_23f750() { @@ -6,9 +10,10 @@ void textureNumLevels_23f750() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_23f750(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm index 0d83d808d7..e1fc4b0423 100644 --- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_23f750 "textureNumLevels_23f750" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_23f750 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %14 - OpStore %res %13 +%textureNumLevels_23f750 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_23f750 + %29 = OpFunctionCall %void %textureNumLevels_23f750 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_23f750 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_23f750 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_23f750 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_23f750 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl index 26ea98a171..cb8a248e47 100644 --- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_23f750() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_23f750(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl index ff12574db9..94362c01f4 100644 --- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_2c3575() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_2c3575(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl index 0bd3455df8..c6e6088762 100644 --- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLevels_2c3575() { @@ -6,9 +10,10 @@ void textureNumLevels_2c3575() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_2c3575(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm index 671ebe53a1..2e68eb3991 100644 --- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_2c3575 "textureNumLevels_2c3575" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_2c3575 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_2c3575 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_2c3575 + %29 = OpFunctionCall %void %textureNumLevels_2c3575 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_2c3575 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_2c3575 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_2c3575 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_2c3575 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl index 2cd56a5dd2..c81e5e0078 100644 --- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_2c3575() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_2c3575(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl index 3aaae3866f..0db053815e 100644 --- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_5101cf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_5101cf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl index 4e35f0d352..015129b8e1 100644 --- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLevels_5101cf() { @@ -6,9 +10,10 @@ void textureNumLevels_5101cf() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_5101cf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm index 3ec9308eb8..893e54d9a0 100644 --- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_5101cf "textureNumLevels_5101cf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_5101cf = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %15 - OpStore %res %13 +%textureNumLevels_5101cf = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureNumLevels_5101cf + %30 = OpFunctionCall %void %textureNumLevels_5101cf + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureNumLevels_5101cf +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureNumLevels_5101cf OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLevels_5101cf +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLevels_5101cf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl index fcb851af4a..a09fa48314 100644 --- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_5101cf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_5101cf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl index c56b159e8e..4b1bf08472 100644 --- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_897aaf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_897aaf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl index 4b312a9a51..27dff5255f 100644 --- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureNumLevels_897aaf() { @@ -6,9 +10,10 @@ void textureNumLevels_897aaf() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_897aaf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm index f8da41f1dc..7f4e14e475 100644 --- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_897aaf "textureNumLevels_897aaf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_897aaf = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_897aaf = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_897aaf + %29 = OpFunctionCall %void %textureNumLevels_897aaf + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_897aaf +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_897aaf OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_897aaf +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_897aaf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl index e3ebba55f4..e50b822c4e 100644 --- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_897aaf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_897aaf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl index d6a4013510..7a732a6cf8 100644 --- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_9da7a5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_9da7a5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl index 9572320c76..357c8f1ef6 100644 --- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureNumLevels_9da7a5() { @@ -6,9 +10,10 @@ void textureNumLevels_9da7a5() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_9da7a5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm index cf77846010..705b961df2 100644 --- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_9da7a5 "textureNumLevels_9da7a5" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_9da7a5 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %14 - OpStore %res %13 +%textureNumLevels_9da7a5 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_9da7a5 + %29 = OpFunctionCall %void %textureNumLevels_9da7a5 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_9da7a5 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_9da7a5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_9da7a5 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_9da7a5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl index 77ca44a2c4..553de75509 100644 --- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_9da7a5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_9da7a5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl index 0647fbcc74..84619bcedb 100644 --- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_a91c03() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_a91c03(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl index 150bdad83e..040d13fc27 100644 --- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLevels_a91c03() { @@ -6,9 +10,10 @@ void textureNumLevels_a91c03() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_a91c03(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm index ad51d5b77e..8fef955acb 100644 --- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_a91c03 "textureNumLevels_a91c03" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,32 +34,44 @@ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_a91c03 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %14 - OpStore %res %13 +%textureNumLevels_a91c03 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_a91c03 + %29 = OpFunctionCall %void %textureNumLevels_a91c03 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_a91c03 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_a91c03 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_a91c03 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_a91c03 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl index 3df9c9a981..6210fcfee2 100644 --- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_a91c03() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_a91c03(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl index f7692cf51b..0ef43211fc 100644 --- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_aee7c8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_aee7c8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl index 72487b6041..d57d775f39 100644 --- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLevels_aee7c8() { @@ -6,9 +10,10 @@ void textureNumLevels_aee7c8() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_aee7c8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm index 69d6d18292..690441aba9 100644 --- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_aee7c8 "textureNumLevels_aee7c8" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_aee7c8 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_aee7c8 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_aee7c8 + %29 = OpFunctionCall %void %textureNumLevels_aee7c8 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_aee7c8 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_aee7c8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_aee7c8 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_aee7c8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl index c962a084dc..d72d4f98f2 100644 --- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_aee7c8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_aee7c8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl index 6973944319..429de95446 100644 --- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_b1b12b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_b1b12b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl index 6ef32a8225..20efec78a3 100644 --- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureNumLevels_b1b12b() { @@ -6,9 +10,10 @@ void textureNumLevels_b1b12b() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_b1b12b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm index 38e86868dc..7263834931 100644 --- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_b1b12b "textureNumLevels_b1b12b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_b1b12b = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_b1b12b = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_b1b12b + %29 = OpFunctionCall %void %textureNumLevels_b1b12b + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_b1b12b +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_b1b12b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_b1b12b +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_b1b12b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl index 049e8fef3e..feabd39a12 100644 --- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_b1b12b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_b1b12b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl index 8a828c72a0..89b7bc27b1 100644 --- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_b4f5ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_b4f5ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl index 508d470a72..68f76972ee 100644 --- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureNumLevels_b4f5ea() { @@ -6,9 +10,10 @@ void textureNumLevels_b4f5ea() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_b4f5ea(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm index 7f154b620a..23c469e56a 100644 --- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_b4f5ea "textureNumLevels_b4f5ea" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_b4f5ea = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %15 - OpStore %res %13 +%textureNumLevels_b4f5ea = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureNumLevels_b4f5ea + %30 = OpFunctionCall %void %textureNumLevels_b4f5ea + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureNumLevels_b4f5ea +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureNumLevels_b4f5ea OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLevels_b4f5ea +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLevels_b4f5ea OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl index 7039b9448d..dab28157d5 100644 --- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_b4f5ea() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_b4f5ea(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl index 03e60ce737..7a3fdfd251 100644 --- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_d004a9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_d004a9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl index 50f47279d0..4266415630 100644 --- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLevels_d004a9() { @@ -6,9 +10,10 @@ void textureNumLevels_d004a9() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_d004a9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm index 2c1f0f84ae..18fa3a1ab3 100644 --- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_d004a9 "textureNumLevels_d004a9" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_d004a9 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %14 - OpStore %res %13 +%textureNumLevels_d004a9 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_d004a9 + %29 = OpFunctionCall %void %textureNumLevels_d004a9 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_d004a9 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_d004a9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_d004a9 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_d004a9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl index 725295989e..b782e1e3d8 100644 --- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_d004a9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_d004a9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl index 887a74dad6..76f4446a5c 100644 --- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_dca09e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_dca09e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl index c99f1f5226..a06ee63210 100644 --- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); void textureNumLevels_dca09e() { @@ -6,9 +10,10 @@ void textureNumLevels_dca09e() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_dca09e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm index 1df5c53b9b..025d472a32 100644 --- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_dca09e "textureNumLevels_dca09e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_dca09e = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_dca09e = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_dca09e + %29 = OpFunctionCall %void %textureNumLevels_dca09e + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_dca09e +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_dca09e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_dca09e +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_dca09e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl index d4e4a04bc0..89ab726bde 100644 --- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_dca09e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_dca09e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl index f8aca61ca9..bda7ba2057 100644 --- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_e67231() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_e67231(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl index 9650c5864d..e0c8b84105 100644 --- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); void textureNumLevels_e67231() { @@ -6,9 +10,10 @@ void textureNumLevels_e67231() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_e67231(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm index cd2fa742ed..b2e72df037 100644 --- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_e67231 "textureNumLevels_e67231" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_e67231 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_e67231 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_e67231 + %29 = OpFunctionCall %void %textureNumLevels_e67231 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_e67231 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_e67231 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_e67231 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_e67231 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl index ec3dbc1252..bd49a993d6 100644 --- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_e67231() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_e67231(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl index c4d793538f..6936e5c72e 100644 --- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_ed078b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_ed078b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl index 96fdcf83d1..72fdf4c58b 100644 --- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); void textureNumLevels_ed078b() { @@ -6,9 +10,10 @@ void textureNumLevels_ed078b() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_ed078b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm index 54f3ef5c89..7713a7e7a3 100644 --- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_ed078b "textureNumLevels_ed078b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_ed078b = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %15 - OpStore %res %13 +%textureNumLevels_ed078b = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureNumLevels_ed078b + %30 = OpFunctionCall %void %textureNumLevels_ed078b + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureNumLevels_ed078b +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureNumLevels_ed078b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLevels_ed078b +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLevels_ed078b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl index cd4237da44..949c1e5681 100644 --- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_ed078b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_ed078b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl index 7f05b5cf78..9f2c8cdb0c 100644 --- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_f46ec6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_f46ec6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl index a40d646a14..cb9af0598b 100644 --- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); void textureNumLevels_f46ec6() { @@ -6,9 +10,10 @@ void textureNumLevels_f46ec6() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_f46ec6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm index 0a842b6853..6c31bf7905 100644 --- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm @@ -1,27 +1,31 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_f46ec6 "textureNumLevels_f46ec6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,33 +34,45 @@ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_f46ec6 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQueryLevels %int %15 - OpStore %res %13 +%textureNumLevels_f46ec6 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQueryLevels %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureNumLevels_f46ec6 + %30 = OpFunctionCall %void %textureNumLevels_f46ec6 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureNumLevels_f46ec6 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureNumLevels_f46ec6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumLevels_f46ec6 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumLevels_f46ec6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl index fa0b57a9fb..4a52159ce2 100644 --- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_f46ec6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_f46ec6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl index 364f974837..865c922f23 100644 --- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl @@ -28,8 +28,9 @@ fn textureNumLevels_f5828d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_f5828d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl index 370e9e97c7..bd9da4c36c 100644 --- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); void textureNumLevels_f5828d() { @@ -6,9 +10,10 @@ void textureNumLevels_f5828d() { int res = tint_tmp.w; } -void vertex_main() { +tint_symbol vertex_main() { textureNumLevels_f5828d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm index 7691bf96f7..5013da472d 100644 --- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumLevels_f5828d "textureNumLevels_f5828d" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumLevels_f5828d = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQueryLevels %int %14 - OpStore %res %12 +%textureNumLevels_f5828d = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQueryLevels %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumLevels_f5828d + %29 = OpFunctionCall %void %textureNumLevels_f5828d + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumLevels_f5828d +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumLevels_f5828d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumLevels_f5828d +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumLevels_f5828d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl index 560204079d..cb1948c008 100644 --- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumLevels_f5828d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumLevels_f5828d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl index 1f161e56cd..561b73ef98 100644 --- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl @@ -28,8 +28,9 @@ fn textureNumSamples_2c6f14() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumSamples_2c6f14(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl index a304fa0c4c..5349dfa387 100644 --- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureNumSamples_2c6f14() { @@ -6,9 +10,10 @@ void textureNumSamples_2c6f14() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumSamples_2c6f14(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm index 3babdf6135..9536280cf2 100644 --- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumSamples_2c6f14 "textureNumSamples_2c6f14" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %float 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumSamples_2c6f14 = OpFunction %void None %8 - %11 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %12 = OpImageQuerySamples %int %14 - OpStore %res %12 +%textureNumSamples_2c6f14 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %16 = OpImageQuerySamples %int %18 + OpStore %res %16 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumSamples_2c6f14 + %29 = OpFunctionCall %void %textureNumSamples_2c6f14 + %30 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %8 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumSamples_2c6f14 +%fragment_main = OpFunction %void None %12 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumSamples_2c6f14 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumSamples_2c6f14 +%compute_main = OpFunction %void None %12 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumSamples_2c6f14 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl index f1f538bee2..9b3b2c4591 100644 --- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumSamples_2c6f14() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumSamples_2c6f14(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl index b29f0bdc08..ead1c72c76 100644 --- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl @@ -28,8 +28,9 @@ fn textureNumSamples_42f8bb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumSamples_42f8bb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl index 99a097360a..1243e4d95a 100644 --- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureNumSamples_42f8bb() { @@ -6,9 +10,10 @@ void textureNumSamples_42f8bb() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumSamples_42f8bb(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm index 646c0b05ae..5ebd9f3dd3 100644 --- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumSamples_42f8bb "textureNumSamples_42f8bb" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %_ptr_Function_int = OpTypePointer Function %int - %18 = OpConstantNull %int + %22 = OpConstantNull %int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumSamples_42f8bb = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %18 - %15 = OpLoad %7 %arg_0 - %13 = OpImageQuerySamples %int %15 - OpStore %res %13 +%textureNumSamples_42f8bb = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %22 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySamples %int %19 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureNumSamples_42f8bb + %30 = OpFunctionCall %void %textureNumSamples_42f8bb + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureNumSamples_42f8bb +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureNumSamples_42f8bb OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureNumSamples_42f8bb +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureNumSamples_42f8bb OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl index bf84412fd6..f1b303fe17 100644 --- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumSamples_42f8bb() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumSamples_42f8bb(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl index b92b2e4dd5..4865a1c714 100644 --- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl @@ -28,8 +28,9 @@ fn textureNumSamples_449d23() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumSamples_449d23(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl index 770966107c..040f168f04 100644 --- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DMS arg_0 : register(t0, space1); void textureNumSamples_449d23() { @@ -6,9 +10,10 @@ void textureNumSamples_449d23() { int res = tint_tmp.z; } -void vertex_main() { +tint_symbol vertex_main() { textureNumSamples_449d23(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm index 60f158a319..66f448c9cd 100644 --- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm @@ -1,26 +1,30 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability ImageQuery OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureNumSamples_449d23 "textureNumSamples_449d23" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int 2D 0 0 1 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %_ptr_Function_int = OpTypePointer Function %int - %17 = OpConstantNull %int + %21 = OpConstantNull %int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureNumSamples_449d23 = OpFunction %void None %9 - %12 = OpLabel - %res = OpVariable %_ptr_Function_int Function %17 - %14 = OpLoad %7 %arg_0 - %13 = OpImageQuerySamples %int %14 - OpStore %res %13 +%textureNumSamples_449d23 = OpFunction %void None %13 + %16 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %18 = OpLoad %7 %arg_0 + %17 = OpImageQuerySamples %int %18 + OpStore %res %17 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureNumSamples_449d23 + %29 = OpFunctionCall %void %textureNumSamples_449d23 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureNumSamples_449d23 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureNumSamples_449d23 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureNumSamples_449d23 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureNumSamples_449d23 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl index 7c15b3e9ed..e2c08118cf 100644 --- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureNumSamples_449d23() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureNumSamples_449d23(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl index 9ed9baebd5..6c3da5f491 100644 --- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_21402b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_21402b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl index 5ad324ff28..5387f2e92a 100644 --- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_21402b() { float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_21402b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm index 0241ae0dfa..757d428511 100644 --- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 36 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_21402b "textureSampleGrad_21402b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,38 +37,48 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %22 = OpConstantNull %v3float + %25 = OpConstantNull %v3float %_ptr_Function_v4float = OpTypePointer Function %v4float - %25 = OpConstantNull %v4float + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_21402b = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %25 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22 - OpStore %res %15 +%textureSampleGrad_21402b = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad %25 %25 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %27 = OpLabel - OpStore %tint_pointsize %float_1 - %29 = OpFunctionCall %void %textureSampleGrad_21402b - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float %31 = OpLabel - %32 = OpFunctionCall %void %textureSampleGrad_21402b + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %34 = OpLabel +%vertex_main = OpFunction %void None %15 + %33 = OpLabel + OpStore %tint_pointsize %float_1 %35 = OpFunctionCall %void %textureSampleGrad_21402b + %36 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleGrad_21402b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleGrad_21402b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl index 59d954e9fc..d7f061feec 100644 --- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_21402b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_21402b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl index 009ad75f04..9429060dc6 100644 --- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_2ecd8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_2ecd8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl index 2c7cb0ff53..eac63da226 100644 --- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_2ecd8f() { float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_2ecd8f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm index b0f83d444a..da659313c7 100644 --- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 42 +; Bound: 49 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_2ecd8f "textureSampleGrad_2ecd8f" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,44 +37,54 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v2float = OpTypeVector %float 2 - %28 = OpConstantNull %v2float + %31 = OpConstantNull %v2float %_ptr_Function_v4float = OpTypePointer Function %v4float - %31 = OpConstantNull %v4float + %34 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_2ecd8f = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %31 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %23 = OpConvertSToF %float %int_1 - %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23 - %15 = OpImageSampleExplicitLod %v4float %20 %26 Grad %28 %28 - OpStore %res %15 +%textureSampleGrad_2ecd8f = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %26 = OpConvertSToF %float %int_1 + %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26 + %19 = OpImageSampleExplicitLod %v4float %23 %29 Grad %31 %31 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %33 = OpLabel - OpStore %tint_pointsize %float_1 - %35 = OpFunctionCall %void %textureSampleGrad_2ecd8f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %34 +%tint_symbol = OpFunctionParameter %v4float %37 = OpLabel - %38 = OpFunctionCall %void %textureSampleGrad_2ecd8f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %40 = OpLabel +%vertex_main = OpFunction %void None %15 + %39 = OpLabel + OpStore %tint_pointsize %float_1 %41 = OpFunctionCall %void %textureSampleGrad_2ecd8f + %42 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleGrad_2ecd8f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %47 = OpLabel + %48 = OpFunctionCall %void %textureSampleGrad_2ecd8f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl index eba29dfafc..c44c1098a9 100644 --- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_2ecd8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_2ecd8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl index 2c535b9884..1b486d12d9 100644 --- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_468f88() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_468f88(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl index 912a6da3e6..f61c3263df 100644 --- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_468f88() { float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_468f88(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm index c112502e88..9d30fbc80f 100644 --- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 46 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_468f88 "textureSampleGrad_468f88" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,41 +37,51 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %22 = OpConstantNull %v2float + %25 = OpConstantNull %v2float %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %25 = OpConstantNull %v2int + %28 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %28 = OpConstantNull %v4float + %31 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_468f88 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %28 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25 - OpStore %res %15 +%textureSampleGrad_468f88 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad|ConstOffset %25 %25 %28 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleGrad_468f88 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %31 +%tint_symbol = OpFunctionParameter %v4float %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleGrad_468f88 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %37 = OpLabel +%vertex_main = OpFunction %void None %15 + %36 = OpLabel + OpStore %tint_pointsize %float_1 %38 = OpFunctionCall %void %textureSampleGrad_468f88 + %39 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleGrad_468f88 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleGrad_468f88 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl index 3d447deb06..e0a8effe06 100644 --- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_468f88() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_468f88(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl index bd953b6962..50c6737158 100644 --- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_521263() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_521263(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl index e8774371b5..ca916b150d 100644 --- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_521263() { float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_521263(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm index daa1cf8712..415b703133 100644 --- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 36 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_521263 "textureSampleGrad_521263" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,38 +37,48 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %22 = OpConstantNull %v2float + %25 = OpConstantNull %v2float %_ptr_Function_v4float = OpTypePointer Function %v4float - %25 = OpConstantNull %v4float + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_521263 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %25 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22 - OpStore %res %15 +%textureSampleGrad_521263 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad %25 %25 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %27 = OpLabel - OpStore %tint_pointsize %float_1 - %29 = OpFunctionCall %void %textureSampleGrad_521263 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float %31 = OpLabel - %32 = OpFunctionCall %void %textureSampleGrad_521263 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %34 = OpLabel +%vertex_main = OpFunction %void None %15 + %33 = OpLabel + OpStore %tint_pointsize %float_1 %35 = OpFunctionCall %void %textureSampleGrad_521263 + %36 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleGrad_521263 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleGrad_521263 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl index 283882bc95..7647aca85c 100644 --- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_521263() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_521263(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl index e8f8c81a44..ef0434ccde 100644 --- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_5312f4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_5312f4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl index add7e2596d..e0eb958f43 100644 --- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_5312f4() { float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_5312f4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm index 018f69ada0..0cc1c9a61d 100644 --- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 36 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_5312f4 "textureSampleGrad_5312f4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,38 +37,48 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %22 = OpConstantNull %v3float + %25 = OpConstantNull %v3float %_ptr_Function_v4float = OpTypePointer Function %v4float - %25 = OpConstantNull %v4float + %28 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_5312f4 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %25 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22 - OpStore %res %15 +%textureSampleGrad_5312f4 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad %25 %25 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %27 = OpLabel - OpStore %tint_pointsize %float_1 - %29 = OpFunctionCall %void %textureSampleGrad_5312f4 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %28 +%tint_symbol = OpFunctionParameter %v4float %31 = OpLabel - %32 = OpFunctionCall %void %textureSampleGrad_5312f4 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %34 = OpLabel +%vertex_main = OpFunction %void None %15 + %33 = OpLabel + OpStore %tint_pointsize %float_1 %35 = OpFunctionCall %void %textureSampleGrad_5312f4 + %36 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleGrad_5312f4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleGrad_5312f4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl index fe32c14134..3e3a8fa8a9 100644 --- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_5312f4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_5312f4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl index 3c64ddaaeb..6f3e3b3334 100644 --- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_872f00() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_872f00(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl index cbe1a90ded..7b4c65f492 100644 --- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_872f00() { float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_872f00(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm index 3d88c6f06d..4cb56d1cfc 100644 --- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 44 +; Bound: 51 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_872f00 "textureSampleGrad_872f00" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,46 +37,56 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v2float = OpTypeVector %float 2 - %28 = OpConstantNull %v2float + %31 = OpConstantNull %v2float %v2int = OpTypeVector %int 2 - %30 = OpConstantNull %v2int + %33 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %33 = OpConstantNull %v4float + %36 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_872f00 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %33 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %23 = OpConvertSToF %float %int_1 - %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23 - %15 = OpImageSampleExplicitLod %v4float %20 %26 Grad|ConstOffset %28 %28 %30 - OpStore %res %15 +%textureSampleGrad_872f00 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %26 = OpConvertSToF %float %int_1 + %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26 + %19 = OpImageSampleExplicitLod %v4float %23 %29 Grad|ConstOffset %31 %31 %33 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %35 = OpLabel - OpStore %tint_pointsize %float_1 - %37 = OpFunctionCall %void %textureSampleGrad_872f00 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %36 +%tint_symbol = OpFunctionParameter %v4float %39 = OpLabel - %40 = OpFunctionCall %void %textureSampleGrad_872f00 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %42 = OpLabel +%vertex_main = OpFunction %void None %15 + %41 = OpLabel + OpStore %tint_pointsize %float_1 %43 = OpFunctionCall %void %textureSampleGrad_872f00 + %44 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %46 = OpLabel + %47 = OpFunctionCall %void %textureSampleGrad_872f00 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %49 = OpLabel + %50 = OpFunctionCall %void %textureSampleGrad_872f00 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl index 1519468626..5d9c2200a9 100644 --- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_872f00() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_872f00(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl index dd1843cb33..0688c3bb16 100644 --- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_e383db() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_e383db(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl index c5e5cb1dc5..4fd9ec2b5c 100644 --- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_e383db() { float4 res = arg_0.SampleGrad(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_e383db(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm index f53698ca07..6a84f1fde1 100644 --- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm @@ -1,12 +1,12 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 41 +; Bound: 48 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -14,8 +14,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_e383db "textureSampleGrad_e383db" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -34,43 +38,53 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v3float = OpTypeVector %float 3 - %27 = OpConstantNull %v3float + %30 = OpConstantNull %v3float %_ptr_Function_v4float = OpTypePointer Function %v4float - %30 = OpConstantNull %v4float + %33 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_e383db = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %30 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %22 = OpConvertSToF %float %int_1 - %25 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %22 - %15 = OpImageSampleExplicitLod %v4float %20 %25 Grad %27 %27 - OpStore %res %15 +%textureSampleGrad_e383db = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %25 = OpConvertSToF %float %int_1 + %28 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %25 + %19 = OpImageSampleExplicitLod %v4float %23 %28 Grad %30 %30 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %32 = OpLabel - OpStore %tint_pointsize %float_1 - %34 = OpFunctionCall %void %textureSampleGrad_e383db - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %33 +%tint_symbol = OpFunctionParameter %v4float %36 = OpLabel - %37 = OpFunctionCall %void %textureSampleGrad_e383db + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %39 = OpLabel +%vertex_main = OpFunction %void None %15 + %38 = OpLabel + OpStore %tint_pointsize %float_1 %40 = OpFunctionCall %void %textureSampleGrad_e383db + %41 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %43 = OpLabel + %44 = OpFunctionCall %void %textureSampleGrad_e383db + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %46 = OpLabel + %47 = OpFunctionCall %void %textureSampleGrad_e383db OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl index a528a162a7..24058e15f7 100644 --- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_e383db() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_e383db(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl index 0570dd9d5b..fdaa7c1720 100644 --- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl @@ -29,8 +29,9 @@ fn textureSampleGrad_e9a2f7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_e9a2f7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl index aeb94451f3..f06b186874 100644 --- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleGrad_e9a2f7() { float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleGrad_e9a2f7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm index e523af4594..b13faa081f 100644 --- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 46 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleGrad_e9a2f7 "textureSampleGrad_e9a2f7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,41 +37,51 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %22 = OpConstantNull %v3float + %25 = OpConstantNull %v3float %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %25 = OpConstantNull %v3int + %28 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %28 = OpConstantNull %v4float + %31 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleGrad_e9a2f7 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %28 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25 - OpStore %res %15 +%textureSampleGrad_e9a2f7 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad|ConstOffset %25 %25 %28 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleGrad_e9a2f7 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %31 +%tint_symbol = OpFunctionParameter %v4float %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleGrad_e9a2f7 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %37 = OpLabel +%vertex_main = OpFunction %void None %15 + %36 = OpLabel + OpStore %tint_pointsize %float_1 %38 = OpFunctionCall %void %textureSampleGrad_e9a2f7 + %39 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleGrad_e9a2f7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleGrad_e9a2f7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl index e92d43a021..0448afb8c7 100644 --- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleGrad_e9a2f7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleGrad_e9a2f7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl index b557f04c25..97d0aadc6f 100644 --- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_02be59() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_02be59(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl index e67e8af3c9..35661af252 100644 --- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_02be59() { float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_02be59(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm index de6563c09a..9887bb9c0c 100644 --- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 47 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_02be59 "textureSampleLevel_02be59" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,41 +37,52 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %20 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %23 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %23 = OpConstantNull %v2float + %26 = OpConstantNull %v2float %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_float = OpTypePointer Function %float + %32 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_02be59 = OpFunction %void None %11 - %14 = OpLabel +%textureSampleLevel_02be59 = OpFunction %void None %15 + %18 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %18 = OpLoad %10 %arg_1 - %19 = OpLoad %7 %arg_0 - %21 = OpSampledImage %20 %19 %18 - %24 = OpConvertSToF %float %int_1 - %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24 - %15 = OpCompositeExtract %float %16 0 - OpStore %res %15 + %21 = OpLoad %10 %arg_1 + %22 = OpLoad %7 %arg_0 + %24 = OpSampledImage %23 %22 %21 + %27 = OpConvertSToF %float %int_1 + %20 = OpImageSampleExplicitLod %v4float %24 %26 Lod %27 + %19 = OpCompositeExtract %float %20 0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleLevel_02be59 +%tint_symbol_2 = OpFunction %void None %32 +%tint_symbol = OpFunctionParameter %v4float + %35 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleLevel_02be59 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %37 = OpLabel - %38 = OpFunctionCall %void %textureSampleLevel_02be59 + OpStore %tint_pointsize %float_1 + %39 = OpFunctionCall %void %textureSampleLevel_02be59 + %40 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %42 = OpLabel + %43 = OpFunctionCall %void %textureSampleLevel_02be59 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %45 = OpLabel + %46 = OpFunctionCall %void %textureSampleLevel_02be59 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl index c2f0d11a26..467c56beba 100644 --- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_02be59() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_02be59(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl index d7dd70b1e8..00bdfbfc65 100644 --- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_0bdd9a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_0bdd9a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl index 7267bff09e..d0c44fc729 100644 --- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_0bdd9a() { float4 res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_0bdd9a(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm index ea7ebbf184..5d4ebadbd7 100644 --- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm @@ -1,12 +1,12 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 46 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -14,8 +14,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_0bdd9a "textureSampleLevel_0bdd9a" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -34,41 +38,51 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %float_1 = OpConstant %float 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %29 = OpConstantNull %v4float -%textureSampleLevel_0bdd9a = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %29 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %22 = OpConvertSToF %float %int_1 - %25 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %22 - %15 = OpImageSampleExplicitLod %v4float %20 %25 Lod %float_1 - OpStore %res %15 + %32 = OpTypeFunction %void %v4float +%textureSampleLevel_0bdd9a = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %25 = OpConvertSToF %float %int_1 + %28 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %25 + %19 = OpImageSampleExplicitLod %v4float %23 %28 Lod %float_1 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %31 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleLevel_0bdd9a +%tint_symbol_2 = OpFunction %void None %32 +%tint_symbol = OpFunctionParameter %v4float + %35 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleLevel_0bdd9a - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %37 = OpLabel + OpStore %tint_pointsize %float_1 %38 = OpFunctionCall %void %textureSampleLevel_0bdd9a + %39 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleLevel_0bdd9a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleLevel_0bdd9a OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl index 1e77805245..1b313b9657 100644 --- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_0bdd9a() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_0bdd9a(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl index e983a8c4cc..df7ab39201 100644 --- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_1b0291() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_1b0291(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl index dd4acbfeaa..b2aacb4563 100644 --- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_1b0291() { float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_1b0291(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm index a0202c2e06..f93c2a5503 100644 --- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 47 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_1b0291 "textureSampleLevel_1b0291" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,41 +37,52 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %20 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %23 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %23 = OpConstantNull %v3float + %26 = OpConstantNull %v3float %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_float = OpTypePointer Function %float + %32 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_1b0291 = OpFunction %void None %11 - %14 = OpLabel +%textureSampleLevel_1b0291 = OpFunction %void None %15 + %18 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %18 = OpLoad %10 %arg_1 - %19 = OpLoad %7 %arg_0 - %21 = OpSampledImage %20 %19 %18 - %24 = OpConvertSToF %float %int_1 - %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24 - %15 = OpCompositeExtract %float %16 0 - OpStore %res %15 + %21 = OpLoad %10 %arg_1 + %22 = OpLoad %7 %arg_0 + %24 = OpSampledImage %23 %22 %21 + %27 = OpConvertSToF %float %int_1 + %20 = OpImageSampleExplicitLod %v4float %24 %26 Lod %27 + %19 = OpCompositeExtract %float %20 0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleLevel_1b0291 +%tint_symbol_2 = OpFunction %void None %32 +%tint_symbol = OpFunctionParameter %v4float + %35 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleLevel_1b0291 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %37 = OpLabel - %38 = OpFunctionCall %void %textureSampleLevel_1b0291 + OpStore %tint_pointsize %float_1 + %39 = OpFunctionCall %void %textureSampleLevel_1b0291 + %40 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %42 = OpLabel + %43 = OpFunctionCall %void %textureSampleLevel_1b0291 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %45 = OpLabel + %46 = OpFunctionCall %void %textureSampleLevel_1b0291 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl index e24aebbbfa..50a6b8a38d 100644 --- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_1b0291() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_1b0291(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl index cbb37ce58a..c1a02b52d0 100644 --- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_1bf73e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_1bf73e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl index f1ef0f0fa9..1e738d3df5 100644 --- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_1bf73e() { float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_1bf73e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm index 2f2429b5bf..8462388345 100644 --- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 41 +; Bound: 49 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_1bf73e "textureSampleLevel_1bf73e" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,43 +37,54 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %20 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %23 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_float = OpTypePointer Function %float + %34 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_1bf73e = OpFunction %void None %11 - %14 = OpLabel +%textureSampleLevel_1bf73e = OpFunction %void None %15 + %18 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %18 = OpLoad %10 %arg_1 - %19 = OpLoad %7 %arg_0 - %21 = OpSampledImage %20 %19 %18 - %24 = OpConvertSToF %float %int_1 - %27 = OpCompositeConstruct %v3float %float_0 %float_0 %24 - %28 = OpConvertSToF %float %int_1 - %16 = OpImageSampleExplicitLod %v4float %21 %27 Lod %28 - %15 = OpCompositeExtract %float %16 0 - OpStore %res %15 + %21 = OpLoad %10 %arg_1 + %22 = OpLoad %7 %arg_0 + %24 = OpSampledImage %23 %22 %21 + %27 = OpConvertSToF %float %int_1 + %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27 + %31 = OpConvertSToF %float %int_1 + %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod %31 + %19 = OpCompositeExtract %float %20 0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %32 = OpLabel - OpStore %tint_pointsize %float_1 - %34 = OpFunctionCall %void %textureSampleLevel_1bf73e +%tint_symbol_2 = OpFunction %void None %34 +%tint_symbol = OpFunctionParameter %v4float + %37 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %36 = OpLabel - %37 = OpFunctionCall %void %textureSampleLevel_1bf73e - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %39 = OpLabel - %40 = OpFunctionCall %void %textureSampleLevel_1bf73e + OpStore %tint_pointsize %float_1 + %41 = OpFunctionCall %void %textureSampleLevel_1bf73e + %42 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleLevel_1bf73e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %47 = OpLabel + %48 = OpFunctionCall %void %textureSampleLevel_1bf73e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl index c76783b648..a0f783e9a8 100644 --- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_1bf73e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_1bf73e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl index 8c7e833df1..8fd17be53a 100644 --- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_302be4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_302be4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl index 3476f09f25..4fb0a22452 100644 --- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_302be4() { float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_302be4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm index f6b4e486e4..febef40e50 100644 --- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 40 +; Bound: 47 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_302be4 "textureSampleLevel_302be4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,42 +37,52 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %float_1 = OpConstant %float 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %30 = OpConstantNull %v4float -%textureSampleLevel_302be4 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %30 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %23 = OpConvertSToF %float %int_1 - %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23 - %15 = OpImageSampleExplicitLod %v4float %20 %26 Lod %float_1 - OpStore %res %15 + %33 = OpTypeFunction %void %v4float +%textureSampleLevel_302be4 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %26 = OpConvertSToF %float %int_1 + %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26 + %19 = OpImageSampleExplicitLod %v4float %23 %29 Lod %float_1 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %32 = OpLabel - OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureSampleLevel_302be4 +%tint_symbol_2 = OpFunction %void None %33 +%tint_symbol = OpFunctionParameter %v4float + %36 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %35 = OpLabel - %36 = OpFunctionCall %void %textureSampleLevel_302be4 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %38 = OpLabel + OpStore %tint_pointsize %float_1 %39 = OpFunctionCall %void %textureSampleLevel_302be4 + %40 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %42 = OpLabel + %43 = OpFunctionCall %void %textureSampleLevel_302be4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %45 = OpLabel + %46 = OpFunctionCall %void %textureSampleLevel_302be4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl index e2c86f1e7e..f631dca074 100644 --- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_302be4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_302be4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl index 20c5d2dc0b..df7abe8b4a 100644 --- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_47daa4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_47daa4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl index 1fa7f9101e..70e06bd8d7 100644 --- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_47daa4() { float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1, int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_47daa4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm index 237ca8a67e..c42defbc0c 100644 --- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 41 +; Bound: 49 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_47daa4 "textureSampleLevel_47daa4" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,43 +37,54 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %20 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %23 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %23 = OpConstantNull %v2float + %26 = OpConstantNull %v2float %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v2int = OpTypeVector %int 2 - %28 = OpConstantNull %v2int + %31 = OpConstantNull %v2int %_ptr_Function_float = OpTypePointer Function %float + %34 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_47daa4 = OpFunction %void None %11 - %14 = OpLabel +%textureSampleLevel_47daa4 = OpFunction %void None %15 + %18 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %18 = OpLoad %10 %arg_1 - %19 = OpLoad %7 %arg_0 - %21 = OpSampledImage %20 %19 %18 - %24 = OpConvertSToF %float %int_1 - %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod|ConstOffset %24 %28 - %15 = OpCompositeExtract %float %16 0 - OpStore %res %15 + %21 = OpLoad %10 %arg_1 + %22 = OpLoad %7 %arg_0 + %24 = OpSampledImage %23 %22 %21 + %27 = OpConvertSToF %float %int_1 + %20 = OpImageSampleExplicitLod %v4float %24 %26 Lod|ConstOffset %27 %31 + %19 = OpCompositeExtract %float %20 0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %32 = OpLabel - OpStore %tint_pointsize %float_1 - %34 = OpFunctionCall %void %textureSampleLevel_47daa4 +%tint_symbol_2 = OpFunction %void None %34 +%tint_symbol = OpFunctionParameter %v4float + %37 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %36 = OpLabel - %37 = OpFunctionCall %void %textureSampleLevel_47daa4 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %39 = OpLabel - %40 = OpFunctionCall %void %textureSampleLevel_47daa4 + OpStore %tint_pointsize %float_1 + %41 = OpFunctionCall %void %textureSampleLevel_47daa4 + %42 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleLevel_47daa4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %47 = OpLabel + %48 = OpFunctionCall %void %textureSampleLevel_47daa4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl index 7c3690fcad..21b05c19b0 100644 --- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_47daa4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_47daa4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl index 17be2cb309..58203cb3aa 100644 --- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_690d95() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_690d95(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl index 104391cd71..2f5f8b170f 100644 --- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_690d95() { float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_690d95(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm index 459833dcda..4c6afe00cc 100644 --- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 46 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_690d95 "textureSampleLevel_690d95" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,41 +37,51 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %22 = OpConstantNull %v2float + %25 = OpConstantNull %v2float %float_1 = OpConstant %float 1 %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %26 = OpConstantNull %v2int + %29 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %29 = OpConstantNull %v4float -%textureSampleLevel_690d95 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %29 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26 - OpStore %res %15 + %32 = OpTypeFunction %void %v4float +%textureSampleLevel_690d95 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod|ConstOffset %float_1 %29 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %31 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleLevel_690d95 +%tint_symbol_2 = OpFunction %void None %32 +%tint_symbol = OpFunctionParameter %v4float + %35 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleLevel_690d95 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %37 = OpLabel + OpStore %tint_pointsize %float_1 %38 = OpFunctionCall %void %textureSampleLevel_690d95 + %39 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleLevel_690d95 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleLevel_690d95 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl index 6296395b37..505e311751 100644 --- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_690d95() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_690d95(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl index ca08cfa77c..88a0bae1c6 100644 --- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_979816() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_979816(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl index 3955bcf84f..872c6af21b 100644 --- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_979816() { float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_979816(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm index 13c98662fe..c8f76e038e 100644 --- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 37 +; Bound: 44 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_979816 "textureSampleLevel_979816" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,39 +37,49 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %22 = OpConstantNull %v2float + %25 = OpConstantNull %v2float %float_0 = OpConstant %float 0 %_ptr_Function_v4float = OpTypePointer Function %v4float - %26 = OpConstantNull %v4float + %29 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_979816 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %26 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_0 - OpStore %res %15 +%textureSampleLevel_979816 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %28 = OpLabel - OpStore %tint_pointsize %float_1 - %30 = OpFunctionCall %void %textureSampleLevel_979816 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %11 +%tint_symbol_2 = OpFunction %void None %29 +%tint_symbol = OpFunctionParameter %v4float %32 = OpLabel - %33 = OpFunctionCall %void %textureSampleLevel_979816 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %11 - %35 = OpLabel +%vertex_main = OpFunction %void None %15 + %34 = OpLabel + OpStore %tint_pointsize %float_1 %36 = OpFunctionCall %void %textureSampleLevel_979816 + %37 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %39 = OpLabel + %40 = OpFunctionCall %void %textureSampleLevel_979816 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %42 = OpLabel + %43 = OpFunctionCall %void %textureSampleLevel_979816 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl index aef0711f79..26ba255e16 100644 --- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_979816() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_979816(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl index edd4babe5f..233f3d1e55 100644 --- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_9bd37b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_9bd37b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl index b0833fb924..0db8ec823e 100644 --- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_9bd37b() { float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f, int3(0, 0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_9bd37b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm index fbc52c7622..bbb579de21 100644 --- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 39 +; Bound: 46 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_9bd37b "textureSampleLevel_9bd37b" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,41 +37,51 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %22 = OpConstantNull %v3float + %25 = OpConstantNull %v3float %float_1 = OpConstant %float 1 %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %26 = OpConstantNull %v3int + %29 = OpConstantNull %v3int %_ptr_Function_v4float = OpTypePointer Function %v4float - %29 = OpConstantNull %v4float -%textureSampleLevel_9bd37b = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %29 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26 - OpStore %res %15 + %32 = OpTypeFunction %void %v4float +%textureSampleLevel_9bd37b = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod|ConstOffset %float_1 %29 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %31 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureSampleLevel_9bd37b +%tint_symbol_2 = OpFunction %void None %32 +%tint_symbol = OpFunctionParameter %v4float + %35 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %34 = OpLabel - %35 = OpFunctionCall %void %textureSampleLevel_9bd37b - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %37 = OpLabel + OpStore %tint_pointsize %float_1 %38 = OpFunctionCall %void %textureSampleLevel_9bd37b + %39 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleLevel_9bd37b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleLevel_9bd37b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl index c8d0cb1241..e6986c4ebe 100644 --- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_9bd37b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_9bd37b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl index cbda792085..8c5cd808e1 100644 --- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_a4af26() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_a4af26(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl index 0e206148b1..4afbbb19d9 100644 --- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_a4af26() { float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1.0f, int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_a4af26(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm index f6449ee2ca..188ce078bb 100644 --- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 42 +; Bound: 49 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_a4af26 "textureSampleLevel_a4af26" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,44 +37,54 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %float_1 = OpConstant %float 1 %v2int = OpTypeVector %int 2 - %29 = OpConstantNull %v2int + %32 = OpConstantNull %v2int %_ptr_Function_v4float = OpTypePointer Function %v4float - %32 = OpConstantNull %v4float -%textureSampleLevel_a4af26 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %32 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %23 = OpConvertSToF %float %int_1 - %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23 - %15 = OpImageSampleExplicitLod %v4float %20 %26 Lod|ConstOffset %float_1 %29 - OpStore %res %15 + %35 = OpTypeFunction %void %v4float +%textureSampleLevel_a4af26 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %26 = OpConvertSToF %float %int_1 + %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26 + %19 = OpImageSampleExplicitLod %v4float %23 %29 Lod|ConstOffset %float_1 %32 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %34 = OpLabel - OpStore %tint_pointsize %float_1 - %35 = OpFunctionCall %void %textureSampleLevel_a4af26 +%tint_symbol_2 = OpFunction %void None %35 +%tint_symbol = OpFunctionParameter %v4float + %38 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %37 = OpLabel - %38 = OpFunctionCall %void %textureSampleLevel_a4af26 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %40 = OpLabel + OpStore %tint_pointsize %float_1 %41 = OpFunctionCall %void %textureSampleLevel_a4af26 + %42 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %44 = OpLabel + %45 = OpFunctionCall %void %textureSampleLevel_a4af26 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %47 = OpLabel + %48 = OpFunctionCall %void %textureSampleLevel_a4af26 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl index db51737d5f..6c46516ec0 100644 --- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_a4af26() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_a4af26(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl index ad8f4833a6..d6690e1959 100644 --- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_abfcc0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_abfcc0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl index 8ec0780248..4cfd9c8dba 100644 --- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture3D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_abfcc0() { float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_abfcc0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm index 9ad4e35ce2..3b16f624dc 100644 --- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 36 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_abfcc0 "textureSampleLevel_abfcc0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,38 +37,48 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %22 = OpConstantNull %v3float + %25 = OpConstantNull %v3float %float_1 = OpConstant %float 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %26 = OpConstantNull %v4float -%textureSampleLevel_abfcc0 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %26 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1 - OpStore %res %15 + %29 = OpTypeFunction %void %v4float +%textureSampleLevel_abfcc0 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_1 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %28 = OpLabel - OpStore %tint_pointsize %float_1 - %29 = OpFunctionCall %void %textureSampleLevel_abfcc0 +%tint_symbol_2 = OpFunction %void None %29 +%tint_symbol = OpFunctionParameter %v4float + %32 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %31 = OpLabel - %32 = OpFunctionCall %void %textureSampleLevel_abfcc0 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %34 = OpLabel + OpStore %tint_pointsize %float_1 %35 = OpFunctionCall %void %textureSampleLevel_abfcc0 + %36 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleLevel_abfcc0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleLevel_abfcc0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl index 0613aea4f6..f883e50ad1 100644 --- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_abfcc0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_abfcc0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl index 36ed893df3..5aff85216c 100644 --- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_ae5e39() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_ae5e39(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl index 69978eb36e..7f7fe7e477 100644 --- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCubeArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_ae5e39() { float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_ae5e39(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm index 907f80dc71..d895f59a7d 100644 --- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm @@ -1,12 +1,12 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 40 +; Bound: 48 ; Schema: 0 OpCapability Shader OpCapability SampledCubeArray OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -14,8 +14,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_ae5e39 "textureSampleLevel_ae5e39" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -24,6 +27,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -34,42 +38,53 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %20 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %23 = OpTypeSampledImage %7 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %_ptr_Function_float = OpTypePointer Function %float + %33 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_ae5e39 = OpFunction %void None %11 - %14 = OpLabel +%textureSampleLevel_ae5e39 = OpFunction %void None %15 + %18 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %18 = OpLoad %10 %arg_1 - %19 = OpLoad %7 %arg_0 - %21 = OpSampledImage %20 %19 %18 - %23 = OpConvertSToF %float %int_1 - %26 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %23 - %27 = OpConvertSToF %float %int_1 - %16 = OpImageSampleExplicitLod %v4float %21 %26 Lod %27 - %15 = OpCompositeExtract %float %16 0 - OpStore %res %15 + %21 = OpLoad %10 %arg_1 + %22 = OpLoad %7 %arg_0 + %24 = OpSampledImage %23 %22 %21 + %26 = OpConvertSToF %float %int_1 + %29 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %26 + %30 = OpConvertSToF %float %int_1 + %20 = OpImageSampleExplicitLod %v4float %24 %29 Lod %30 + %19 = OpCompositeExtract %float %20 0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %31 = OpLabel - OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureSampleLevel_ae5e39 +%tint_symbol_2 = OpFunction %void None %33 +%tint_symbol = OpFunctionParameter %v4float + %36 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %35 = OpLabel - %36 = OpFunctionCall %void %textureSampleLevel_ae5e39 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %38 = OpLabel - %39 = OpFunctionCall %void %textureSampleLevel_ae5e39 + OpStore %tint_pointsize %float_1 + %40 = OpFunctionCall %void %textureSampleLevel_ae5e39 + %41 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %43 = OpLabel + %44 = OpFunctionCall %void %textureSampleLevel_ae5e39 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %46 = OpLabel + %47 = OpFunctionCall %void %textureSampleLevel_ae5e39 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl index aaca367080..0756a43885 100644 --- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_ae5e39() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_ae5e39(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl index c25cf35638..f22f02febb 100644 --- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_ba93b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_ba93b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl index 91349dd98a..193e4ab3aa 100644 --- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2DArray arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_ba93b3() { float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1, int2(0, 0)); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_ba93b3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm index 27be8b23ec..fc2622afa3 100644 --- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 43 +; Bound: 51 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_ba93b3 "textureSampleLevel_ba93b3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,45 +37,56 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %20 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %23 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 %float_0 = OpConstant %float 0 %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v2int = OpTypeVector %int 2 - %30 = OpConstantNull %v2int + %33 = OpConstantNull %v2int %_ptr_Function_float = OpTypePointer Function %float + %36 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureSampleLevel_ba93b3 = OpFunction %void None %11 - %14 = OpLabel +%textureSampleLevel_ba93b3 = OpFunction %void None %15 + %18 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %18 = OpLoad %10 %arg_1 - %19 = OpLoad %7 %arg_0 - %21 = OpSampledImage %20 %19 %18 - %24 = OpConvertSToF %float %int_1 - %27 = OpCompositeConstruct %v3float %float_0 %float_0 %24 - %28 = OpConvertSToF %float %int_1 - %16 = OpImageSampleExplicitLod %v4float %21 %27 Lod|ConstOffset %28 %30 - %15 = OpCompositeExtract %float %16 0 - OpStore %res %15 + %21 = OpLoad %10 %arg_1 + %22 = OpLoad %7 %arg_0 + %24 = OpSampledImage %23 %22 %21 + %27 = OpConvertSToF %float %int_1 + %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27 + %31 = OpConvertSToF %float %int_1 + %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod|ConstOffset %31 %33 + %19 = OpCompositeExtract %float %20 0 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %34 = OpLabel - OpStore %tint_pointsize %float_1 - %36 = OpFunctionCall %void %textureSampleLevel_ba93b3 +%tint_symbol_2 = OpFunction %void None %36 +%tint_symbol = OpFunctionParameter %v4float + %39 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %38 = OpLabel - %39 = OpFunctionCall %void %textureSampleLevel_ba93b3 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %41 = OpLabel - %42 = OpFunctionCall %void %textureSampleLevel_ba93b3 + OpStore %tint_pointsize %float_1 + %43 = OpFunctionCall %void %textureSampleLevel_ba93b3 + %44 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %46 = OpLabel + %47 = OpFunctionCall %void %textureSampleLevel_ba93b3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %49 = OpLabel + %50 = OpFunctionCall %void %textureSampleLevel_ba93b3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl index de65319943..2d3ff58b15 100644 --- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_ba93b3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_ba93b3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl index d510ee8f83..4890371aef 100644 --- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_c32df7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_c32df7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl index dddaff2fb7..86fcaa0fa9 100644 --- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + TextureCube arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_c32df7() { float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_c32df7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm index e16c043cdb..0f377eebcd 100644 --- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 36 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_c32df7 "textureSampleLevel_c32df7" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,38 +37,48 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v3float = OpTypeVector %float 3 - %22 = OpConstantNull %v3float + %25 = OpConstantNull %v3float %float_1 = OpConstant %float 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %26 = OpConstantNull %v4float -%textureSampleLevel_c32df7 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %26 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1 - OpStore %res %15 + %29 = OpTypeFunction %void %v4float +%textureSampleLevel_c32df7 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_1 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %28 = OpLabel - OpStore %tint_pointsize %float_1 - %29 = OpFunctionCall %void %textureSampleLevel_c32df7 +%tint_symbol_2 = OpFunction %void None %29 +%tint_symbol = OpFunctionParameter %v4float + %32 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %31 = OpLabel - %32 = OpFunctionCall %void %textureSampleLevel_c32df7 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %34 = OpLabel + OpStore %tint_pointsize %float_1 %35 = OpFunctionCall %void %textureSampleLevel_c32df7 + %36 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleLevel_c32df7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleLevel_c32df7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl index 556751a1c9..aef0bf57a4 100644 --- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_c32df7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_c32df7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl index 39e1e8c19d..b145d8af94 100644 --- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl @@ -29,8 +29,9 @@ fn textureSampleLevel_c6aca6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_c6aca6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl index 6e7600dfc2..5987ae8444 100644 --- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl @@ -1,3 +1,7 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + Texture2D arg_0 : register(t0, space1); SamplerState arg_1 : register(s1, space1); @@ -5,9 +9,10 @@ void textureSampleLevel_c6aca6() { float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureSampleLevel_c6aca6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm index 94044770e0..3c7813db8f 100644 --- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 36 +; Bound: 43 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft @@ -13,8 +13,11 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %arg_1 "arg_1" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureSampleLevel_c6aca6 "textureSampleLevel_c6aca6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -23,6 +26,7 @@ OpDecorate %arg_0 Binding 0 OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 Binding 1 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -33,38 +37,48 @@ %10 = OpTypeSampler %_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant - %void = OpTypeVoid - %11 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %19 = OpTypeSampledImage %7 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %14 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14 + %void = OpTypeVoid + %15 = OpTypeFunction %void + %22 = OpTypeSampledImage %7 %v2float = OpTypeVector %float 2 - %22 = OpConstantNull %v2float + %25 = OpConstantNull %v2float %float_1 = OpConstant %float 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %26 = OpConstantNull %v4float -%textureSampleLevel_c6aca6 = OpFunction %void None %11 - %14 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %26 - %17 = OpLoad %10 %arg_1 - %18 = OpLoad %7 %arg_0 - %20 = OpSampledImage %19 %18 %17 - %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1 - OpStore %res %15 + %29 = OpTypeFunction %void %v4float +%textureSampleLevel_c6aca6 = OpFunction %void None %15 + %18 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %14 + %20 = OpLoad %10 %arg_1 + %21 = OpLoad %7 %arg_0 + %23 = OpSampledImage %22 %21 %20 + %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_1 + OpStore %res %19 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %11 - %28 = OpLabel - OpStore %tint_pointsize %float_1 - %29 = OpFunctionCall %void %textureSampleLevel_c6aca6 +%tint_symbol_2 = OpFunction %void None %29 +%tint_symbol = OpFunctionParameter %v4float + %32 = OpLabel + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %11 - %31 = OpLabel - %32 = OpFunctionCall %void %textureSampleLevel_c6aca6 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %11 +%vertex_main = OpFunction %void None %15 %34 = OpLabel + OpStore %tint_pointsize %float_1 %35 = OpFunctionCall %void %textureSampleLevel_c6aca6 + %36 = OpFunctionCall %void %tint_symbol_2 %14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %15 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleLevel_c6aca6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %15 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleLevel_c6aca6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl index 3baacae31f..04fac3a2b2 100644 --- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl @@ -7,8 +7,9 @@ fn textureSampleLevel_c6aca6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureSampleLevel_c6aca6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl index f0df428e30..877e6f0b09 100644 --- a/test/intrinsics/gen/textureStore/05ce15.wgsl +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl @@ -28,8 +28,9 @@ fn textureStore_05ce15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_05ce15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl index d38cd87c15..ca8dc95037 100644 --- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_05ce15() { arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_05ce15(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm index d9b79d5ebf..ee23e7f5b0 100644 --- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_05ce15 "textureStore_05ce15" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v2int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_05ce15 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_05ce15 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_05ce15 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_05ce15 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_05ce15 + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_05ce15 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_05ce15 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl index 75c0ae2f7e..f31db20d61 100644 --- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_05ce15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_05ce15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl index caa9253b55..a999c8b3d3 100644 --- a/test/intrinsics/gen/textureStore/064c7f.wgsl +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl @@ -28,8 +28,9 @@ fn textureStore_064c7f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_064c7f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl index 85108a6bd4..f627b4d498 100644 --- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_064c7f() { arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_064c7f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm index 97edb60927..b4bba705b0 100644 --- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_064c7f "textureStore_064c7f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,43 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v2int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_064c7f = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_064c7f = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_064c7f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_064c7f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_064c7f + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_064c7f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_064c7f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl index 500c2a187c..46247d551c 100644 --- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_064c7f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_064c7f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/068641.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl index b5a277b795..27c616e07c 100644 --- a/test/intrinsics/gen/textureStore/068641.wgsl +++ b/test/intrinsics/gen/textureStore/068641.wgsl @@ -28,8 +28,9 @@ fn textureStore_068641() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_068641(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl index e744a5eded..89951d9d65 100644 --- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_068641() { arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_068641(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm index 17de55622e..ad9d55cda5 100644 --- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_068641 "textureStore_068641" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_068641 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_068641 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_068641 + %31 = OpFunctionCall %void %textureStore_068641 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_068641 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_068641 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_068641 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_068641 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl index 1cff6cd7b0..dbb407b086 100644 --- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_068641() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_068641(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl index dbcb216325..24c67b79e1 100644 --- a/test/intrinsics/gen/textureStore/0af6b5.wgsl +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl @@ -28,8 +28,9 @@ fn textureStore_0af6b5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_0af6b5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl index 6e80c554df..45c7624045 100644 --- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_0af6b5() { arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_0af6b5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm index d651f50989..d83c8d982b 100644 --- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_0af6b5 "textureStore_0af6b5" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 2D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v2int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_0af6b5 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_0af6b5 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_0af6b5 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_0af6b5 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_0af6b5 + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_0af6b5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_0af6b5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl index dedf0b6e71..6a1e8ddf14 100644 --- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_0af6b5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_0af6b5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl index b6189de99d..5133f2e903 100644 --- a/test/intrinsics/gen/textureStore/0c3dff.wgsl +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl @@ -28,8 +28,9 @@ fn textureStore_0c3dff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_0c3dff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl index dcc9b15586..2212b8669c 100644 --- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_0c3dff() { arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_0c3dff(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm index 32263fd741..0bc05e883f 100644 --- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_0c3dff "textureStore_0c3dff" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_0c3dff = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_0c3dff = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_0c3dff + %31 = OpFunctionCall %void %textureStore_0c3dff + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_0c3dff +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_0c3dff OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_0c3dff +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_0c3dff OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl index 6420eaf7e7..96e508b7a9 100644 --- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_0c3dff() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_0c3dff(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/102722.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl index c1c0bf41bb..37c8455d58 100644 --- a/test/intrinsics/gen/textureStore/102722.wgsl +++ b/test/intrinsics/gen/textureStore/102722.wgsl @@ -28,8 +28,9 @@ fn textureStore_102722() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_102722(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl index bfbb63b9c1..b6604d9b96 100644 --- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_102722() { arg_0[1] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_102722(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm index 0406d1563a..1fc763e85d 100644 --- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_102722 "textureStore_102722" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v4uint = OpTypeVector %uint 4 - %18 = OpConstantNull %v4uint + %22 = OpConstantNull %v4uint + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_102722 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %18 +%textureStore_102722 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_102722 + %30 = OpFunctionCall %void %textureStore_102722 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_102722 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_102722 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_102722 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_102722 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl index bab8dc470a..78bc05dfbb 100644 --- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_102722() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_102722(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl index 5296393fef..70562e807e 100644 --- a/test/intrinsics/gen/textureStore/1bbd08.wgsl +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl @@ -28,8 +28,9 @@ fn textureStore_1bbd08() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_1bbd08(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl index 561bce98b8..870bbe9b1a 100644 --- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_1bbd08() { arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_1bbd08(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm index 9bde491971..f177c1bae2 100644 --- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_1bbd08 "textureStore_1bbd08" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v3int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_1bbd08 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_1bbd08 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_1bbd08 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_1bbd08 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_1bbd08 + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_1bbd08 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_1bbd08 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl index 0b676c29a8..d265bc0449 100644 --- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_1bbd08() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_1bbd08(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl index 0170e0094e..134e7f8e2f 100644 --- a/test/intrinsics/gen/textureStore/1c02e7.wgsl +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl @@ -28,8 +28,9 @@ fn textureStore_1c02e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_1c02e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl index eead151ada..e0d03089c1 100644 --- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_1c02e7() { arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_1c02e7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm index b1fef26ff8..6f3cf7b53a 100644 --- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_1c02e7 "textureStore_1c02e7" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,34 +32,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4int = OpTypeVector %int 4 - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_1c02e7 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %18 %20 +%textureStore_1c02e7 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %22 %24 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_1c02e7 + %32 = OpFunctionCall %void %textureStore_1c02e7 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_1c02e7 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_1c02e7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureStore_1c02e7 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureStore_1c02e7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl index 715524fae5..17368d27ac 100644 --- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_1c02e7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_1c02e7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl index 815e628eed..ada2279b77 100644 --- a/test/intrinsics/gen/textureStore/22d955.wgsl +++ b/test/intrinsics/gen/textureStore/22d955.wgsl @@ -28,8 +28,9 @@ fn textureStore_22d955() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_22d955(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl index 20cec3849f..0d9852c6ff 100644 --- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_22d955() { arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_22d955(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm index 01dc1ccd1f..bde97620fb 100644 --- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_22d955 "textureStore_22d955" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4uint = OpTypeVector %uint 4 - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_22d955 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %19 %21 +%textureStore_22d955 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %23 %25 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureStore_22d955 + %33 = OpFunctionCall %void %textureStore_22d955 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_22d955 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_22d955 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureStore_22d955 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureStore_22d955 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl index 08c8bb1a13..cb9bde4993 100644 --- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_22d955() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_22d955(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl index 693d8e8432..6f8b38ddec 100644 --- a/test/intrinsics/gen/textureStore/26bf70.wgsl +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl @@ -28,8 +28,9 @@ fn textureStore_26bf70() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_26bf70(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl index 8a9bbda461..323424c001 100644 --- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_26bf70() { arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_26bf70(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm index 2a8ef15692..ba254cc166 100644 --- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_26bf70 "textureStore_26bf70" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_26bf70 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_26bf70 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_26bf70 + %31 = OpFunctionCall %void %textureStore_26bf70 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_26bf70 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_26bf70 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_26bf70 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_26bf70 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl index d1ff649d71..a2bb93d1db 100644 --- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_26bf70() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_26bf70(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl index 3b2e3b2791..627e15fc9e 100644 --- a/test/intrinsics/gen/textureStore/2796b4.wgsl +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl @@ -28,8 +28,9 @@ fn textureStore_2796b4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2796b4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl index 88e1e0f292..ead20b9444 100644 --- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_2796b4() { arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_2796b4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm index e26f6b6dad..3c77ab24dd 100644 --- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_2796b4 "textureStore_2796b4" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_2796b4 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_2796b4 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_2796b4 + %30 = OpFunctionCall %void %textureStore_2796b4 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_2796b4 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_2796b4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_2796b4 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_2796b4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl index d307706df5..f541a87ffb 100644 --- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_2796b4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2796b4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl index 7a5200fb65..882b7662f9 100644 --- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl @@ -28,8 +28,9 @@ fn textureStore_2ac6c7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2ac6c7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl index 2e5bd837cc..0427db5089 100644 --- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_2ac6c7() { arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_2ac6c7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm index 6a05c5c7ad..ae332480af 100644 --- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_2ac6c7 "textureStore_2ac6c7" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,42 @@ %7 = OpTypeImage %float 1D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_2ac6c7 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %int_1 %17 +%textureStore_2ac6c7 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %int_1 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_2ac6c7 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_2ac6c7 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel +%vertex_main = OpFunction %void None %12 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %textureStore_2ac6c7 + %28 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %30 = OpLabel + %31 = OpFunctionCall %void %textureStore_2ac6c7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_2ac6c7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl index 7d3f57a4ef..6dd1a80eb3 100644 --- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_2ac6c7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2ac6c7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl index 2f4f9d7d94..18b7284d56 100644 --- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl @@ -28,8 +28,9 @@ fn textureStore_2eb2a4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2eb2a4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl index 2bfcdebb87..b44f1ad731 100644 --- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_2eb2a4() { arg_0[1] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_2eb2a4(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm index fd59253d09..01255a8d16 100644 --- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_2eb2a4 "textureStore_2eb2a4" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v4uint = OpTypeVector %uint 4 - %18 = OpConstantNull %v4uint + %22 = OpConstantNull %v4uint + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_2eb2a4 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %18 +%textureStore_2eb2a4 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_2eb2a4 + %30 = OpFunctionCall %void %textureStore_2eb2a4 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_2eb2a4 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_2eb2a4 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_2eb2a4 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_2eb2a4 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl index f62d13756e..c1d63b6f00 100644 --- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_2eb2a4() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2eb2a4(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl index c710a474c9..ac2c48e3a8 100644 --- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl @@ -28,8 +28,9 @@ fn textureStore_2ed2a3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2ed2a3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl index 61caf3b2d8..cf0bd1e146 100644 --- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_2ed2a3() { arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_2ed2a3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm index 3c4624c899..e517f8c32d 100644 --- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_2ed2a3 "textureStore_2ed2a3" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,42 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_2ed2a3 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %int_1 %17 +%textureStore_2ed2a3 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %int_1 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_2ed2a3 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_2ed2a3 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel +%vertex_main = OpFunction %void None %12 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %textureStore_2ed2a3 + %28 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %30 = OpLabel + %31 = OpFunctionCall %void %textureStore_2ed2a3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_2ed2a3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl index 366b088640..adb55f630a 100644 --- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_2ed2a3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_2ed2a3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl index be9ae4069e..68d862eaa4 100644 --- a/test/intrinsics/gen/textureStore/31745b.wgsl +++ b/test/intrinsics/gen/textureStore/31745b.wgsl @@ -28,8 +28,9 @@ fn textureStore_31745b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_31745b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl index 2205238aa3..6978776c31 100644 --- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_31745b() { arg_0[int2(0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_31745b(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm index 101f8dd792..d2216e9f20 100644 --- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_31745b "textureStore_31745b" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_31745b = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_31745b = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_31745b + %30 = OpFunctionCall %void %textureStore_31745b + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_31745b +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_31745b OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_31745b +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_31745b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl index fc1848fcf2..0349879561 100644 --- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_31745b() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_31745b(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl index 82fea1780f..e4104c3f86 100644 --- a/test/intrinsics/gen/textureStore/32f368.wgsl +++ b/test/intrinsics/gen/textureStore/32f368.wgsl @@ -28,8 +28,9 @@ fn textureStore_32f368() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_32f368(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl index 1b4385dec4..f8e91482d9 100644 --- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_32f368() { arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_32f368(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm index 63c2b1cf51..9c38831c31 100644 --- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_32f368 "textureStore_32f368" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,35 +31,45 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 - %v4float = OpTypeVector %float 4 - %20 = OpConstantNull %v4float + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_32f368 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %18 %20 +%textureStore_32f368 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %22 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_32f368 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_32f368 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureStore_32f368 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_32f368 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_32f368 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl index 43d6af5634..c7addc8076 100644 --- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_32f368() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_32f368(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl index f4bf4e4681..a5934bbcdf 100644 --- a/test/intrinsics/gen/textureStore/331aee.wgsl +++ b/test/intrinsics/gen/textureStore/331aee.wgsl @@ -28,8 +28,9 @@ fn textureStore_331aee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_331aee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl index ef51064172..acb18d1608 100644 --- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_331aee() { arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_331aee(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm index 1c6d255e14..d6ba2735bc 100644 --- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_331aee "textureStore_331aee" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v3int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_331aee = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_331aee = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_331aee - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_331aee + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_331aee + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_331aee + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_331aee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl index d1ed0c6401..3d47b3886f 100644 --- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_331aee() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_331aee(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl index e6bb10305f..713b571847 100644 --- a/test/intrinsics/gen/textureStore/38e8d7.wgsl +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl @@ -28,8 +28,9 @@ fn textureStore_38e8d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_38e8d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl index 23abfe3264..10ad900175 100644 --- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_38e8d7() { arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_38e8d7(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm index fd1b989cfb..1a7da57aa8 100644 --- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_38e8d7 "textureStore_38e8d7" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4uint = OpTypeVector %uint 4 - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_38e8d7 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %19 %21 +%textureStore_38e8d7 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %23 %25 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureStore_38e8d7 + %33 = OpFunctionCall %void %textureStore_38e8d7 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_38e8d7 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_38e8d7 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureStore_38e8d7 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureStore_38e8d7 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl index 50a53ca677..f87ee3ef54 100644 --- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_38e8d7() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_38e8d7(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl index c815964f55..30e16f0a4e 100644 --- a/test/intrinsics/gen/textureStore/3a52ac.wgsl +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl @@ -28,8 +28,9 @@ fn textureStore_3a52ac() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_3a52ac(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl index 1ccbf60e14..fa6c84b020 100644 --- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_3a52ac() { arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_3a52ac(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm index c033a5b458..04f98b5e4c 100644 --- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_3a52ac "textureStore_3a52ac" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,34 +32,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4int = OpTypeVector %int 4 - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_3a52ac = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %18 %20 +%textureStore_3a52ac = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %22 %24 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_3a52ac + %32 = OpFunctionCall %void %textureStore_3a52ac + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_3a52ac +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_3a52ac OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureStore_3a52ac +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureStore_3a52ac OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl index 85d39aabd7..2eadd38bc2 100644 --- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_3a52ac() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_3a52ac(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl index 3ee4fd6bac..ce30a0c00b 100644 --- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl @@ -28,8 +28,9 @@ fn textureStore_3bb7a1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_3bb7a1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl index a8c5eceabe..1d0803d2d6 100644 --- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_3bb7a1() { arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_3bb7a1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm index 312d77340d..4c4f9d4fc9 100644 --- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_3bb7a1 "textureStore_3bb7a1" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,35 +31,45 @@ %7 = OpTypeImage %float 2D 0 1 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 - %v4float = OpTypeVector %float 4 - %20 = OpConstantNull %v4float + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_3bb7a1 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %18 %20 +%textureStore_3bb7a1 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %22 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_3bb7a1 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_3bb7a1 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureStore_3bb7a1 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_3bb7a1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_3bb7a1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl index 87ece03d14..3171defa7a 100644 --- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_3bb7a1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_3bb7a1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl index aad435ef86..3493941c16 100644 --- a/test/intrinsics/gen/textureStore/3bec15.wgsl +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl @@ -28,8 +28,9 @@ fn textureStore_3bec15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_3bec15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl index cfcedd93cc..9dc0ea8d39 100644 --- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_3bec15() { arg_0[1] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_3bec15(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm index 5a80a9d3b5..fcd3c0c7d9 100644 --- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_3bec15 "textureStore_3bec15" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v4uint = OpTypeVector %uint 4 - %18 = OpConstantNull %v4uint + %22 = OpConstantNull %v4uint + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_3bec15 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %18 +%textureStore_3bec15 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_3bec15 + %30 = OpFunctionCall %void %textureStore_3bec15 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_3bec15 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_3bec15 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_3bec15 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_3bec15 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl index 2cadcbe19d..be5532ba4b 100644 --- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_3bec15() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_3bec15(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl index 5846c1c9e4..212fdf2c17 100644 --- a/test/intrinsics/gen/textureStore/441ba8.wgsl +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl @@ -28,8 +28,9 @@ fn textureStore_441ba8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_441ba8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl index c980a0e8fb..9065ca8c33 100644 --- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_441ba8() { arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_441ba8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm index 40cc744571..68e35fc213 100644 --- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_441ba8 "textureStore_441ba8" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_441ba8 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_441ba8 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_441ba8 + %31 = OpFunctionCall %void %textureStore_441ba8 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_441ba8 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_441ba8 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_441ba8 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_441ba8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl index ac7be08caa..6b61a49212 100644 --- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_441ba8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_441ba8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl index cc4151174b..b7a154fb23 100644 --- a/test/intrinsics/gen/textureStore/4fc057.wgsl +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl @@ -28,8 +28,9 @@ fn textureStore_4fc057() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_4fc057(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl index d7021c1175..d8ecd1319e 100644 --- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_4fc057() { arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_4fc057(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm index 53d44deb44..bc26ddcbec 100644 --- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_4fc057 "textureStore_4fc057" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,35 +31,45 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 - %v4float = OpTypeVector %float 4 - %20 = OpConstantNull %v4float + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_4fc057 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %18 %20 +%textureStore_4fc057 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %22 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_4fc057 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_4fc057 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureStore_4fc057 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_4fc057 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_4fc057 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl index 1a909f8baa..4c0fd68f6a 100644 --- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_4fc057() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_4fc057(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl index 063eecc761..ae4c4914ca 100644 --- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl @@ -28,8 +28,9 @@ fn textureStore_5a2f8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_5a2f8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl index 88412b51ac..498961aa34 100644 --- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_5a2f8f() { arg_0[1] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_5a2f8f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm index 269e38cea1..fb58460ad2 100644 --- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_5a2f8f "textureStore_5a2f8f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,31 +33,43 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int_1 = OpConstant %int 1 %v4int = OpTypeVector %int 4 - %17 = OpConstantNull %v4int + %21 = OpConstantNull %v4int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_5a2f8f = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %17 +%textureStore_5a2f8f = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %21 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_5a2f8f + %29 = OpFunctionCall %void %textureStore_5a2f8f + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_5a2f8f +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureStore_5a2f8f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_5a2f8f +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_5a2f8f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl index 3053085e66..adeefea649 100644 --- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_5a2f8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_5a2f8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl index 55007375f2..3aec6444ea 100644 --- a/test/intrinsics/gen/textureStore/60975f.wgsl +++ b/test/intrinsics/gen/textureStore/60975f.wgsl @@ -28,8 +28,9 @@ fn textureStore_60975f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_60975f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl index e26e62a088..0dcc532c2d 100644 --- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_60975f() { arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_60975f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm index 2336b5377a..c05e7147e7 100644 --- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_60975f "textureStore_60975f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,35 +31,45 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 - %v4float = OpTypeVector %float 4 - %20 = OpConstantNull %v4float + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_60975f = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %18 %20 +%textureStore_60975f = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %22 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_60975f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_60975f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureStore_60975f + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_60975f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_60975f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl index c7689fcbc5..23913666c5 100644 --- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_60975f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_60975f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl index ec1f1ae149..3aae9c4666 100644 --- a/test/intrinsics/gen/textureStore/682fd6.wgsl +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl @@ -28,8 +28,9 @@ fn textureStore_682fd6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_682fd6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl index 3a8b9d07c4..0dced900ff 100644 --- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_682fd6() { arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_682fd6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm index 646031d27a..6ba02163d6 100644 --- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_682fd6 "textureStore_682fd6" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_682fd6 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_682fd6 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_682fd6 + %31 = OpFunctionCall %void %textureStore_682fd6 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_682fd6 +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_682fd6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_682fd6 +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_682fd6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl index 0bfa046cc0..7dcc695abd 100644 --- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_682fd6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_682fd6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl index 187bba1f8f..84367ba0aa 100644 --- a/test/intrinsics/gen/textureStore/6b75c3.wgsl +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl @@ -28,8 +28,9 @@ fn textureStore_6b75c3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6b75c3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl index 677e584e04..c561e4c1d0 100644 --- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_6b75c3() { arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_6b75c3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm index 51ee16a9f2..d373c99e5c 100644 --- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_6b75c3 "textureStore_6b75c3" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,42 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_6b75c3 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %int_1 %17 +%textureStore_6b75c3 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %int_1 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_6b75c3 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_6b75c3 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel +%vertex_main = OpFunction %void None %12 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %textureStore_6b75c3 + %28 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %30 = OpLabel + %31 = OpFunctionCall %void %textureStore_6b75c3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_6b75c3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl index 54e64b0f6e..6ed15c6f6d 100644 --- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_6b75c3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6b75c3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl index cfded420fb..df54e40d3a 100644 --- a/test/intrinsics/gen/textureStore/6b80d2.wgsl +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl @@ -28,8 +28,9 @@ fn textureStore_6b80d2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6b80d2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl index eac402ee29..57de36d563 100644 --- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_6b80d2() { arg_0[1] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_6b80d2(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm index 2ec370c267..87ed017304 100644 --- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_6b80d2 "textureStore_6b80d2" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,31 +33,43 @@ %7 = OpTypeImage %int 1D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int_1 = OpConstant %int 1 %v4int = OpTypeVector %int 4 - %17 = OpConstantNull %v4int + %21 = OpConstantNull %v4int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_6b80d2 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %17 +%textureStore_6b80d2 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %21 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_6b80d2 + %29 = OpFunctionCall %void %textureStore_6b80d2 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_6b80d2 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureStore_6b80d2 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_6b80d2 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_6b80d2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl index 6ab7b61510..6e06e4f7ca 100644 --- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_6b80d2() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6b80d2(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl index 987f5fef8f..cf3b83aed2 100644 --- a/test/intrinsics/gen/textureStore/6cff2e.wgsl +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl @@ -28,8 +28,9 @@ fn textureStore_6cff2e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6cff2e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl index e149a2adbb..90f7d83e5e 100644 --- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_6cff2e() { arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_6cff2e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm index 83a83e7900..30fbe9b222 100644 --- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_6cff2e "textureStore_6cff2e" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_6cff2e = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_6cff2e = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_6cff2e + %31 = OpFunctionCall %void %textureStore_6cff2e + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_6cff2e +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_6cff2e OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_6cff2e +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_6cff2e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl index 85ea47f91d..900cfeab24 100644 --- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_6cff2e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6cff2e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl index e811e0122e..36f45e758b 100644 --- a/test/intrinsics/gen/textureStore/6da692.wgsl +++ b/test/intrinsics/gen/textureStore/6da692.wgsl @@ -28,8 +28,9 @@ fn textureStore_6da692() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6da692(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl index 716225bf33..19a1b5f470 100644 --- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_6da692() { arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_6da692(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm index 6f6bf71b16..6fd25b493f 100644 --- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_6da692 "textureStore_6da692" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4uint = OpTypeVector %uint 4 - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_6da692 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %19 %21 +%textureStore_6da692 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %23 %25 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureStore_6da692 + %33 = OpFunctionCall %void %textureStore_6da692 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_6da692 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_6da692 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureStore_6da692 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureStore_6da692 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl index da170658a0..eec8577504 100644 --- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_6da692() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_6da692(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/731349.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl index ad47ce9902..1cf802a9bb 100644 --- a/test/intrinsics/gen/textureStore/731349.wgsl +++ b/test/intrinsics/gen/textureStore/731349.wgsl @@ -28,8 +28,9 @@ fn textureStore_731349() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_731349(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl index c6530ca8df..3a804945be 100644 --- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_731349() { arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_731349(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm index 577af62004..58b625febf 100644 --- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_731349 "textureStore_731349" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v2int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_731349 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_731349 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_731349 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_731349 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_731349 + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_731349 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_731349 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl index 5b527d84e7..3dc131cefd 100644 --- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_731349() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_731349(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl index 4424bb3ac3..8f50b09dbc 100644 --- a/test/intrinsics/gen/textureStore/752da6.wgsl +++ b/test/intrinsics/gen/textureStore/752da6.wgsl @@ -28,8 +28,9 @@ fn textureStore_752da6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_752da6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl index 60c15a116f..3ab3bcc840 100644 --- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_752da6() { arg_0[int2(0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_752da6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm index 4219376127..6aa38f470b 100644 --- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_752da6 "textureStore_752da6" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_752da6 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_752da6 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_752da6 + %30 = OpFunctionCall %void %textureStore_752da6 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_752da6 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_752da6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_752da6 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_752da6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl index 2348d36c55..8f5dfb6b69 100644 --- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_752da6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_752da6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl index bce5f33880..ef9f8ed0b9 100644 --- a/test/intrinsics/gen/textureStore/77c0ae.wgsl +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl @@ -28,8 +28,9 @@ fn textureStore_77c0ae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_77c0ae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl index 9705f28aff..29ed738ba6 100644 --- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_77c0ae() { arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_77c0ae(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm index 7434c65fdf..22b93d49ad 100644 --- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_77c0ae "textureStore_77c0ae" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %17 = OpConstantNull %v2int + %21 = OpConstantNull %v2int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_77c0ae = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_77c0ae = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_77c0ae + %31 = OpFunctionCall %void %textureStore_77c0ae + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_77c0ae +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_77c0ae OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_77c0ae +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_77c0ae OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl index 8ff941ae46..434cae54df 100644 --- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_77c0ae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_77c0ae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl index 7bf0a3baaa..4399d59030 100644 --- a/test/intrinsics/gen/textureStore/7cec8d.wgsl +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl @@ -28,8 +28,9 @@ fn textureStore_7cec8d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_7cec8d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl index 2068667a1f..51ffaac797 100644 --- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_7cec8d() { arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_7cec8d(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm index 359d905a65..47d10a8054 100644 --- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_7cec8d "textureStore_7cec8d" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,34 +32,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4int = OpTypeVector %int 4 - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_7cec8d = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %18 %20 +%textureStore_7cec8d = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %22 %24 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_7cec8d + %32 = OpFunctionCall %void %textureStore_7cec8d + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_7cec8d +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_7cec8d OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureStore_7cec8d +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureStore_7cec8d OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl index 3ba2f7faad..420fd1ce37 100644 --- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_7cec8d() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_7cec8d(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl index 203a4a5ef0..de0b3e92ee 100644 --- a/test/intrinsics/gen/textureStore/7f7fae.wgsl +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl @@ -28,8 +28,9 @@ fn textureStore_7f7fae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_7f7fae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl index 02423590c1..1da528fa22 100644 --- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_7f7fae() { arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_7f7fae(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm index 6adb368d51..d8b70fef90 100644 --- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_7f7fae "textureStore_7f7fae" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,42 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_7f7fae = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %int_1 %17 +%textureStore_7f7fae = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %int_1 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_7f7fae - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_7f7fae + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel +%vertex_main = OpFunction %void None %12 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %textureStore_7f7fae + %28 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %30 = OpLabel + %31 = OpFunctionCall %void %textureStore_7f7fae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_7f7fae OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl index e8ec3ee480..d0bd9f33e6 100644 --- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_7f7fae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_7f7fae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/804942.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl index a27738f4c2..44ae89d64d 100644 --- a/test/intrinsics/gen/textureStore/804942.wgsl +++ b/test/intrinsics/gen/textureStore/804942.wgsl @@ -28,8 +28,9 @@ fn textureStore_804942() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_804942(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl index 226ade13e2..b835e3343b 100644 --- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_804942() { arg_0[int2(0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_804942(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm index 2a1b747e05..f7b77bbcab 100644 --- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_804942 "textureStore_804942" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 2D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_804942 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_804942 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_804942 + %30 = OpFunctionCall %void %textureStore_804942 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_804942 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_804942 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_804942 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_804942 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl index ed39788e20..3306d47308 100644 --- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_804942() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_804942(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl index 427a6a239a..45c740abcd 100644 --- a/test/intrinsics/gen/textureStore/805dae.wgsl +++ b/test/intrinsics/gen/textureStore/805dae.wgsl @@ -28,8 +28,9 @@ fn textureStore_805dae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_805dae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl index 1556ee195c..fee8e1bbf1 100644 --- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_805dae() { arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_805dae(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm index bdb0957a32..6a2d3866ef 100644 --- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_805dae "textureStore_805dae" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v2int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_805dae = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_805dae = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_805dae - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_805dae + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_805dae + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_805dae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_805dae OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl index 8fd57518db..2e0e003f52 100644 --- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_805dae() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_805dae(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl index c951df77ca..a8951d140a 100644 --- a/test/intrinsics/gen/textureStore/83bcc1.wgsl +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl @@ -28,8 +28,9 @@ fn textureStore_83bcc1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_83bcc1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl index c03732fd4c..bb4b8eb3a8 100644 --- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_83bcc1() { arg_0[1] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_83bcc1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm index ddd4726017..7165fd8f1f 100644 --- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_83bcc1 "textureStore_83bcc1" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,32 +34,44 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v4uint = OpTypeVector %uint 4 - %18 = OpConstantNull %v4uint + %22 = OpConstantNull %v4uint + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_83bcc1 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %18 +%textureStore_83bcc1 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_83bcc1 + %30 = OpFunctionCall %void %textureStore_83bcc1 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_83bcc1 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_83bcc1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_83bcc1 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_83bcc1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl index 6a2ee4104c..76596001d1 100644 --- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_83bcc1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_83bcc1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/872747.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl index f379316420..840b1267f2 100644 --- a/test/intrinsics/gen/textureStore/872747.wgsl +++ b/test/intrinsics/gen/textureStore/872747.wgsl @@ -28,8 +28,9 @@ fn textureStore_872747() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_872747(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl index 26076b1f93..e00dfbdfd4 100644 --- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_872747() { arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_872747(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm index 1a704f62e6..a6fa3f3d6b 100644 --- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_872747 "textureStore_872747" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,42 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_872747 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %int_1 %17 +%textureStore_872747 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %int_1 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_872747 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_872747 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel +%vertex_main = OpFunction %void None %12 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %textureStore_872747 + %28 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %30 = OpLabel + %31 = OpFunctionCall %void %textureStore_872747 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_872747 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl index ff7a941fed..084d473c2d 100644 --- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_872747() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_872747(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl index 9420a69786..75dce21216 100644 --- a/test/intrinsics/gen/textureStore/8e0479.wgsl +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl @@ -28,8 +28,9 @@ fn textureStore_8e0479() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_8e0479(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl index b9dc391309..ca6ebdc2a6 100644 --- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_8e0479() { arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_8e0479(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm index b8b2544a7a..5db1630916 100644 --- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_8e0479 "textureStore_8e0479" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4uint = OpTypeVector %uint 4 - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_8e0479 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %19 %21 +%textureStore_8e0479 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %23 %25 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureStore_8e0479 + %33 = OpFunctionCall %void %textureStore_8e0479 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_8e0479 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_8e0479 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureStore_8e0479 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureStore_8e0479 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl index 5dcee17dac..f390e47f5e 100644 --- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_8e0479() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_8e0479(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl index 268f13bfc1..1b56276c8b 100644 --- a/test/intrinsics/gen/textureStore/8f71a1.wgsl +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl @@ -28,8 +28,9 @@ fn textureStore_8f71a1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_8f71a1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl index 1a241c9bf3..614cc38e17 100644 --- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_8f71a1() { arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_8f71a1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm index 1cf50154f8..4380aacfc0 100644 --- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_8f71a1 "textureStore_8f71a1" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_8f71a1 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_8f71a1 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_8f71a1 + %30 = OpFunctionCall %void %textureStore_8f71a1 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_8f71a1 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_8f71a1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_8f71a1 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_8f71a1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl index 1f64e85fa5..a6df58a912 100644 --- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_8f71a1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_8f71a1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/969534.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl index f80fdf454b..158f0b5208 100644 --- a/test/intrinsics/gen/textureStore/969534.wgsl +++ b/test/intrinsics/gen/textureStore/969534.wgsl @@ -28,8 +28,9 @@ fn textureStore_969534() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_969534(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl index 974bcd9987..9b94d3ff03 100644 --- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_969534() { arg_0[1] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_969534(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm index 0d2b25b90e..bd8a1cc6f9 100644 --- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_969534 "textureStore_969534" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,31 +33,43 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int_1 = OpConstant %int 1 %v4int = OpTypeVector %int 4 - %17 = OpConstantNull %v4int + %21 = OpConstantNull %v4int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_969534 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %17 +%textureStore_969534 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %21 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_969534 + %29 = OpFunctionCall %void %textureStore_969534 + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_969534 +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureStore_969534 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_969534 +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_969534 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl index 53e571fce2..bda2165e82 100644 --- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_969534() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_969534(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl index 3ba13a42ca..0d73175a0b 100644 --- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl @@ -28,8 +28,9 @@ fn textureStore_9a3ecc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_9a3ecc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl index 7252b71988..2d6881cb82 100644 --- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_9a3ecc() { arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_9a3ecc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm index 16257e8a40..65be5938b7 100644 --- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_9a3ecc "textureStore_9a3ecc" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_9a3ecc = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_9a3ecc = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_9a3ecc + %30 = OpFunctionCall %void %textureStore_9a3ecc + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_9a3ecc +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_9a3ecc OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_9a3ecc +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_9a3ecc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl index 727c546e20..1b3385b013 100644 --- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_9a3ecc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_9a3ecc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl index 4f2a3f3e29..02eb723ba0 100644 --- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl @@ -28,8 +28,9 @@ fn textureStore_9d9cd5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_9d9cd5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl index 8c4350d216..43971ad0f3 100644 --- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_9d9cd5() { arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_9d9cd5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm index a719ffe656..52c2c66942 100644 --- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_9d9cd5 "textureStore_9d9cd5" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,35 +31,45 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 - %v4float = OpTypeVector %float 4 - %20 = OpConstantNull %v4float + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_9d9cd5 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %18 %20 +%textureStore_9d9cd5 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %22 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_9d9cd5 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_9d9cd5 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureStore_9d9cd5 + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_9d9cd5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_9d9cd5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl index 6152a0ce32..ca7531519b 100644 --- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_9d9cd5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_9d9cd5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl index 4e4d687ac9..6a6944294f 100644 --- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl @@ -28,8 +28,9 @@ fn textureStore_9e3ec5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_9e3ec5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl index 99edc0a25b..310f67b1e7 100644 --- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_9e3ec5() { arg_0[int2(0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_9e3ec5(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm index d9595b1c51..660a80b286 100644 --- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_9e3ec5 "textureStore_9e3ec5" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_9e3ec5 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_9e3ec5 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_9e3ec5 + %30 = OpFunctionCall %void %textureStore_9e3ec5 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_9e3ec5 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_9e3ec5 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_9e3ec5 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_9e3ec5 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl index c098780cd8..97220bf605 100644 --- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_9e3ec5() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_9e3ec5(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl index e0a32bd291..5e91609665 100644 --- a/test/intrinsics/gen/textureStore/ac67aa.wgsl +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl @@ -28,8 +28,9 @@ fn textureStore_ac67aa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_ac67aa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl index f8880704d1..7185f53c32 100644 --- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_ac67aa() { arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_ac67aa(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm index 9df59a8f78..2df225395e 100644 --- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_ac67aa "textureStore_ac67aa" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,33 +33,45 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_ac67aa = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_ac67aa = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_ac67aa + %31 = OpFunctionCall %void %textureStore_ac67aa + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_ac67aa +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_ac67aa OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_ac67aa +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_ac67aa OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl index ebf8cc506f..f649c8b2d4 100644 --- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_ac67aa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_ac67aa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl index 59b894f573..b95081a81e 100644 --- a/test/intrinsics/gen/textureStore/b706b1.wgsl +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl @@ -28,8 +28,9 @@ fn textureStore_b706b1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_b706b1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl index 6c9a134cec..5ec0692f95 100644 --- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_b706b1() { arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_b706b1(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm index b46f7cba35..e8ce299ebe 100644 --- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_b706b1 "textureStore_b706b1" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_b706b1 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_b706b1 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_b706b1 + %30 = OpFunctionCall %void %textureStore_b706b1 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_b706b1 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_b706b1 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_b706b1 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_b706b1 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl index 6f717da7f5..d5a48e50ce 100644 --- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_b706b1() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_b706b1(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl index e7b41fbd64..efad163bc8 100644 --- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl @@ -28,8 +28,9 @@ fn textureStore_bbcb7f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_bbcb7f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl index df0868cb6e..95ca4235e8 100644 --- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_bbcb7f() { arg_0[int2(0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_bbcb7f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm index 56000e54ee..488c2b54d7 100644 --- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_bbcb7f "textureStore_bbcb7f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int + %20 = OpConstantNull %v2int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_bbcb7f = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_bbcb7f = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_bbcb7f + %30 = OpFunctionCall %void %textureStore_bbcb7f + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_bbcb7f +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_bbcb7f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_bbcb7f +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_bbcb7f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl index af697b0929..4c83b975f0 100644 --- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_bbcb7f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_bbcb7f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl index 6e1aeb99e8..c642eed435 100644 --- a/test/intrinsics/gen/textureStore/be6e30.wgsl +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl @@ -28,8 +28,9 @@ fn textureStore_be6e30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_be6e30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl index 4918e0688b..33fc18289a 100644 --- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2D arg_0 : register(u0, space1); void textureStore_be6e30() { arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_be6e30(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm index ecf44b0c9a..0ad6a57bed 100644 --- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_be6e30 "textureStore_be6e30" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v2int = OpTypeVector %int 2 - %16 = OpConstantNull %v2int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v2int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_be6e30 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_be6e30 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_be6e30 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_be6e30 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_be6e30 + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_be6e30 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_be6e30 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl index 1bd8d78551..cf60e0d30e 100644 --- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_be6e30() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_be6e30(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl index 62c79394cf..831474381e 100644 --- a/test/intrinsics/gen/textureStore/bf775c.wgsl +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl @@ -28,8 +28,9 @@ fn textureStore_bf775c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_bf775c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl index 09c16733e3..5714afae40 100644 --- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_bf775c() { arg_0[1] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_bf775c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm index 8c196e42aa..ad9491a780 100644 --- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_bf775c "textureStore_bf775c" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,31 +33,43 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int_1 = OpConstant %int 1 %v4int = OpTypeVector %int 4 - %17 = OpConstantNull %v4int + %21 = OpConstantNull %v4int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_bf775c = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %17 +%textureStore_bf775c = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %21 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_bf775c + %29 = OpFunctionCall %void %textureStore_bf775c + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_bf775c +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureStore_bf775c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_bf775c +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_bf775c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl index cc479d17a0..08ff4cb160 100644 --- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_bf775c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_bf775c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl index 3cb1ba0d33..53fa5005b0 100644 --- a/test/intrinsics/gen/textureStore/c5af1e.wgsl +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl @@ -28,8 +28,9 @@ fn textureStore_c5af1e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_c5af1e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl index fb292616cf..2f08e1318a 100644 --- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_c5af1e() { arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_c5af1e(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm index fbd7f691d2..88bfeb1f91 100644 --- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_c5af1e "textureStore_c5af1e" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v3int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_c5af1e = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_c5af1e = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_c5af1e - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_c5af1e + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_c5af1e + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_c5af1e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_c5af1e OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl index b973b75eaf..671eef02fa 100644 --- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_c5af1e() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_c5af1e(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl index e4607bbec9..2dfd759182 100644 --- a/test/intrinsics/gen/textureStore/c863be.wgsl +++ b/test/intrinsics/gen/textureStore/c863be.wgsl @@ -28,8 +28,9 @@ fn textureStore_c863be() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_c863be(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl index 1301b870fd..e330dcea7c 100644 --- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_c863be() { arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_c863be(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm index 2efc16ee4e..e93580e294 100644 --- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_c863be "textureStore_c863be" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,35 +32,45 @@ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 - %v4float = OpTypeVector %float 4 - %20 = OpConstantNull %v4float + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_c863be = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %18 %20 +%textureStore_c863be = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %22 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %22 = OpLabel - OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_c863be - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_c863be + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %29 = OpLabel +%vertex_main = OpFunction %void None %12 + %28 = OpLabel + OpStore %tint_pointsize %float_1 %30 = OpFunctionCall %void %textureStore_c863be + %31 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_c863be + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_c863be OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl index 849df749dd..f5d4ab38a6 100644 --- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_c863be() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_c863be(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl index a29020007f..04f84763f1 100644 --- a/test/intrinsics/gen/textureStore/d73b5c.wgsl +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl @@ -28,8 +28,9 @@ fn textureStore_d73b5c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_d73b5c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl index a550f78bf5..bddb309f4e 100644 --- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_d73b5c() { arg_0[1] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_d73b5c(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm index 9bd7a5c03e..d9b731584a 100644 --- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm @@ -1,20 +1,23 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 37 ; Schema: 0 OpCapability Shader OpCapability Image1D OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_d73b5c "textureStore_d73b5c" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -22,6 +25,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -30,31 +34,43 @@ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int_1 = OpConstant %int 1 %v4int = OpTypeVector %int 4 - %17 = OpConstantNull %v4int + %21 = OpConstantNull %v4int + %22 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_d73b5c = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %17 +%textureStore_d73b5c = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %21 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %19 = OpLabel +%tint_symbol_2 = OpFunction %void None %22 +%tint_symbol = OpFunctionParameter %v4float + %25 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %27 = OpLabel OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_d73b5c + %29 = OpFunctionCall %void %textureStore_d73b5c + %30 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_d73b5c +%fragment_main = OpFunction %void None %13 + %32 = OpLabel + %33 = OpFunctionCall %void %textureStore_d73b5c OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_d73b5c +%compute_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_d73b5c OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl index 196631374f..13b319031f 100644 --- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_d73b5c() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_d73b5c(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl index e4ee1e4df4..4b89356785 100644 --- a/test/intrinsics/gen/textureStore/dd7d81.wgsl +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl @@ -28,8 +28,9 @@ fn textureStore_dd7d81() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_dd7d81(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl index b47a495077..bb35e135e9 100644 --- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_dd7d81() { arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_dd7d81(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm index c3658e7a2a..7dacd3f684 100644 --- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_dd7d81 "textureStore_dd7d81" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v3int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_dd7d81 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_dd7d81 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_dd7d81 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_dd7d81 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_dd7d81 + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_dd7d81 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_dd7d81 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl index 7f448d45f0..487e0548c9 100644 --- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_dd7d81() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_dd7d81(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl index 39d1edad82..2351bf9e7b 100644 --- a/test/intrinsics/gen/textureStore/dde364.wgsl +++ b/test/intrinsics/gen/textureStore/dde364.wgsl @@ -28,8 +28,9 @@ fn textureStore_dde364() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_dde364(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl index cd99618869..6f41e2304e 100644 --- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_dde364() { arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_dde364(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm index 847c8f1583..918c3221f0 100644 --- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 32 +; Bound: 41 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_dde364 "textureStore_dde364" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,35 +33,47 @@ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4uint = OpTypeVector %uint 4 - %21 = OpConstantNull %v4uint + %25 = OpConstantNull %v4uint + %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_dde364 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %19 %21 +%textureStore_dde364 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %23 %25 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %23 = OpLabel +%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol = OpFunctionParameter %v4float + %29 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %31 = OpLabel OpStore %tint_pointsize %float_1 - %25 = OpFunctionCall %void %textureStore_dde364 + %33 = OpFunctionCall %void %textureStore_dde364 + %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_dde364 +%fragment_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_dde364 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %30 = OpLabel - %31 = OpFunctionCall %void %textureStore_dde364 +%compute_main = OpFunction %void None %13 + %39 = OpLabel + %40 = OpFunctionCall %void %textureStore_dde364 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl index d03b4887a0..ed94049c2f 100644 --- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_dde364() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_dde364(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl index 013bd3affb..333af95e5a 100644 --- a/test/intrinsics/gen/textureStore/e885e8.wgsl +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl @@ -28,8 +28,9 @@ fn textureStore_e885e8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_e885e8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl index 110b1fdcbf..8aa9d4cadb 100644 --- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_e885e8() { arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_e885e8(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm index 0f1837d7c3..db9ea1dabc 100644 --- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 28 +; Bound: 35 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_e885e8 "textureStore_e885e8" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,42 @@ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 - %v4float = OpTypeVector %float 4 - %17 = OpConstantNull %v4float + %20 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_e885e8 = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %int_1 %17 +%textureStore_e885e8 = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %int_1 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %19 = OpLabel - OpStore %tint_pointsize %float_1 - %21 = OpFunctionCall %void %textureStore_e885e8 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %20 +%tint_symbol = OpFunctionParameter %v4float %23 = OpLabel - %24 = OpFunctionCall %void %textureStore_e885e8 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %26 = OpLabel +%vertex_main = OpFunction %void None %12 + %25 = OpLabel + OpStore %tint_pointsize %float_1 %27 = OpFunctionCall %void %textureStore_e885e8 + %28 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %30 = OpLabel + %31 = OpFunctionCall %void %textureStore_e885e8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_e885e8 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl index e4feafb8d4..53888d3775 100644 --- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_e885e8() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_e885e8(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl index 040b104d1a..ab19ba00f8 100644 --- a/test/intrinsics/gen/textureStore/eb702f.wgsl +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl @@ -28,8 +28,9 @@ fn textureStore_eb702f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_eb702f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl index f2f12171ef..a65d22be4c 100644 --- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_eb702f() { arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_eb702f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm index 805163c438..a33b490801 100644 --- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_eb702f "textureStore_eb702f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -27,33 +31,43 @@ %7 = OpTypeImage %float 3D 0 0 0 2 R32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v3int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_eb702f = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_eb702f = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_eb702f - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_eb702f + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_eb702f + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_eb702f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_eb702f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl index de86b76660..5cf2b135b8 100644 --- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_eb702f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_eb702f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl index 4aa2004677..c19b499cc7 100644 --- a/test/intrinsics/gen/textureStore/eb78b9.wgsl +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl @@ -28,8 +28,9 @@ fn textureStore_eb78b9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_eb78b9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl index 8a2ccfdb6f..859588ae41 100644 --- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_eb78b9() { arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_eb78b9(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm index 2ff5b98472..fec7f882b0 100644 --- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_eb78b9 "textureStore_eb78b9" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,32 +32,44 @@ %7 = OpTypeImage %int 3D 0 0 0 2 R32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int + %20 = OpConstantNull %v3int %v4int = OpTypeVector %int 4 - %18 = OpConstantNull %v4int + %22 = OpConstantNull %v4int + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_eb78b9 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %16 %18 +%textureStore_eb78b9 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %20 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_eb78b9 + %30 = OpFunctionCall %void %textureStore_eb78b9 + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_eb78b9 +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_eb78b9 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_eb78b9 +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_eb78b9 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl index eb766662fc..31287b919e 100644 --- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_eb78b9() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_eb78b9(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl index a1a7801a07..223158c10c 100644 --- a/test/intrinsics/gen/textureStore/ee6acc.wgsl +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl @@ -28,8 +28,9 @@ fn textureStore_ee6acc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_ee6acc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl index a321851ce5..2560aace9d 100644 --- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_ee6acc() { arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_ee6acc(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm index f11aa5cfb5..5a8e5203b4 100644 --- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 36 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_ee6acc "textureStore_ee6acc" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,43 @@ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 %void = OpTypeVoid - %8 = OpTypeFunction %void + %12 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %16 = OpConstantNull %v3int - %v4float = OpTypeVector %float 4 - %18 = OpConstantNull %v4float + %20 = OpConstantNull %v3int + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_ee6acc = OpFunction %void None %8 - %11 = OpLabel - %13 = OpLoad %7 %arg_0 - OpImageWrite %13 %16 %18 +%textureStore_ee6acc = OpFunction %void None %12 + %15 = OpLabel + %17 = OpLoad %7 %arg_0 + OpImageWrite %17 %20 %11 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %8 - %20 = OpLabel - OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_ee6acc - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %8 +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_ee6acc + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %8 - %27 = OpLabel +%vertex_main = OpFunction %void None %12 + %26 = OpLabel + OpStore %tint_pointsize %float_1 %28 = OpFunctionCall %void %textureStore_ee6acc + %29 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %31 = OpLabel + %32 = OpFunctionCall %void %textureStore_ee6acc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_ee6acc OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl index 3530be4e54..c68cc918f6 100644 --- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_ee6acc() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_ee6acc(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl index 541ee39c20..e6370493d1 100644 --- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl @@ -28,8 +28,9 @@ fn textureStore_ef9f2f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_ef9f2f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl index 18e4e26428..68cadd9730 100644 --- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_ef9f2f() { arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_ef9f2f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm index 3d68722b9c..0d35fe854e 100644 --- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_ef9f2f "textureStore_ef9f2f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_ef9f2f = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_ef9f2f = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_ef9f2f + %31 = OpFunctionCall %void %textureStore_ef9f2f + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_ef9f2f +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_ef9f2f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_ef9f2f +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_ef9f2f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl index f2f20c1abe..e8bf5e08f3 100644 --- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_ef9f2f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_ef9f2f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl index dd8a4fbe4a..6c316b68cd 100644 --- a/test/intrinsics/gen/textureStore/f8dead.wgsl +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl @@ -28,8 +28,9 @@ fn textureStore_f8dead() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_f8dead(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl index e6687d3c87..dc3b5d84d4 100644 --- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture3D arg_0 : register(u0, space1); void textureStore_f8dead() { arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_f8dead(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm index f421043c21..382a8c161a 100644 --- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 30 +; Bound: 39 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_f8dead "textureStore_f8dead" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,33 +32,45 @@ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %v3int = OpTypeVector %int 3 - %17 = OpConstantNull %v3int + %21 = OpConstantNull %v3int %v4uint = OpTypeVector %uint 4 - %19 = OpConstantNull %v4uint + %23 = OpConstantNull %v4uint + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_f8dead = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %17 %19 +%textureStore_f8dead = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %21 %23 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %21 = OpLabel +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %29 = OpLabel OpStore %tint_pointsize %float_1 - %23 = OpFunctionCall %void %textureStore_f8dead + %31 = OpFunctionCall %void %textureStore_f8dead + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %25 = OpLabel - %26 = OpFunctionCall %void %textureStore_f8dead +%fragment_main = OpFunction %void None %13 + %34 = OpLabel + %35 = OpFunctionCall %void %textureStore_f8dead OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %28 = OpLabel - %29 = OpFunctionCall %void %textureStore_f8dead +%compute_main = OpFunction %void None %13 + %37 = OpLabel + %38 = OpFunctionCall %void %textureStore_f8dead OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl index 184af581e2..8f23e0ccdc 100644 --- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_f8dead() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_f8dead(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl index 07e21f92af..9ecba9679e 100644 --- a/test/intrinsics/gen/textureStore/f9be83.wgsl +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl @@ -28,8 +28,9 @@ fn textureStore_f9be83() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_f9be83(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl index f4b305b4ae..b671f34a5b 100644 --- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_f9be83() { arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_f9be83(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm index 08795cd65f..af3adfc8e4 100644 --- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpCapability StorageImageExtendedFormats OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_f9be83 "textureStore_f9be83" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,34 +33,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4int = OpTypeVector %int 4 - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_f9be83 = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %18 %20 +%textureStore_f9be83 = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %22 %24 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_f9be83 + %32 = OpFunctionCall %void %textureStore_f9be83 + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_f9be83 +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_f9be83 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureStore_f9be83 +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureStore_f9be83 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl index bdc6309b12..efbe0fe9b0 100644 --- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_f9be83() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_f9be83(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl index 13a69294fa..68e71bb37c 100644 --- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl @@ -28,8 +28,9 @@ fn textureStore_fb9a8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_fb9a8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl index 605ed7396b..b2a2834f48 100644 --- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture1D arg_0 : register(u0, space1); void textureStore_fb9a8f() { arg_0[1] = uint4(0u, 0u, 0u, 0u); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_fb9a8f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm index 32c9ecbe7a..414eb1c51b 100644 --- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm @@ -1,19 +1,22 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 29 +; Bound: 38 ; Schema: 0 OpCapability Shader OpCapability Image1D OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_fb9a8f "textureStore_fb9a8f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -21,6 +24,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -29,32 +33,44 @@ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %int = OpTypeInt 32 1 %int_1 = OpConstant %int 1 %v4uint = OpTypeVector %uint 4 - %18 = OpConstantNull %v4uint + %22 = OpConstantNull %v4uint + %23 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_fb9a8f = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %int_1 %18 +%textureStore_fb9a8f = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %int_1 %22 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %20 = OpLabel +%tint_symbol_2 = OpFunction %void None %23 +%tint_symbol = OpFunctionParameter %v4float + %26 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %28 = OpLabel OpStore %tint_pointsize %float_1 - %22 = OpFunctionCall %void %textureStore_fb9a8f + %30 = OpFunctionCall %void %textureStore_fb9a8f + %31 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %24 = OpLabel - %25 = OpFunctionCall %void %textureStore_fb9a8f +%fragment_main = OpFunction %void None %13 + %33 = OpLabel + %34 = OpFunctionCall %void %textureStore_fb9a8f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %27 = OpLabel - %28 = OpFunctionCall %void %textureStore_fb9a8f +%compute_main = OpFunction %void None %13 + %36 = OpLabel + %37 = OpFunctionCall %void %textureStore_fb9a8f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl index f22a569ccf..78ac35d220 100644 --- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_fb9a8f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_fb9a8f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl index eac93e42c6..a5d4ca6a59 100644 --- a/test/intrinsics/gen/textureStore/fbf53f.wgsl +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl @@ -28,8 +28,9 @@ fn textureStore_fbf53f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_fbf53f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl index 174ca73abc..32afd0db47 100644 --- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + RWTexture2DArray arg_0 : register(u0, space1); void textureStore_fbf53f() { arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0); } -void vertex_main() { +tint_symbol vertex_main() { textureStore_fbf53f(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm index 7f56ec3ccb..3ac4b4d7d0 100644 --- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm @@ -1,18 +1,21 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 31 +; Bound: 40 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" OpName %textureStore_fbf53f "textureStore_fbf53f" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" @@ -20,6 +23,7 @@ OpDecorate %arg_0 NonReadable OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float @@ -28,34 +32,46 @@ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %12 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid - %9 = OpTypeFunction %void + %13 = OpTypeFunction %void %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 %int_1 = OpConstant %int 1 - %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1 + %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1 %v4int = OpTypeVector %int 4 - %20 = OpConstantNull %v4int + %24 = OpConstantNull %v4int + %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureStore_fbf53f = OpFunction %void None %9 - %12 = OpLabel - %14 = OpLoad %7 %arg_0 - OpImageWrite %14 %18 %20 +%textureStore_fbf53f = OpFunction %void None %13 + %16 = OpLabel + %18 = OpLoad %7 %arg_0 + OpImageWrite %18 %22 %24 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %9 - %22 = OpLabel +%tint_symbol_2 = OpFunction %void None %25 +%tint_symbol = OpFunctionParameter %v4float + %28 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %13 + %30 = OpLabel OpStore %tint_pointsize %float_1 - %24 = OpFunctionCall %void %textureStore_fbf53f + %32 = OpFunctionCall %void %textureStore_fbf53f + %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %9 - %26 = OpLabel - %27 = OpFunctionCall %void %textureStore_fbf53f +%fragment_main = OpFunction %void None %13 + %35 = OpLabel + %36 = OpFunctionCall %void %textureStore_fbf53f OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %9 - %29 = OpLabel - %30 = OpFunctionCall %void %textureStore_fbf53f +%compute_main = OpFunction %void None %13 + %38 = OpLabel + %39 = OpFunctionCall %void %textureStore_fbf53f OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl index b19b0a4d0b..18f047138a 100644 --- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl @@ -5,8 +5,9 @@ fn textureStore_fbf53f() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { textureStore_fbf53f(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/562d05.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl index 3358cfff15..63a94b65cc 100644 --- a/test/intrinsics/gen/trunc/562d05.wgsl +++ b/test/intrinsics/gen/trunc/562d05.wgsl @@ -27,8 +27,9 @@ fn trunc_562d05() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_562d05(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl index e1bad912c1..f96d4c8850 100644 --- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void trunc_562d05() { float3 res = trunc(float3(0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { trunc_562d05(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl index 5ed7816eb9..061a926b82 100644 --- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void trunc_562d05() { float3 res = trunc(float3()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { trunc_562d05(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm index ed7d4b7817..adf112b1dd 100644 --- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %trunc_562d05 "trunc_562d05" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v3float = OpTypeVector %float 3 - %12 = OpConstantNull %v3float + %16 = OpConstantNull %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%trunc_562d05 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v3float Function %12 - %9 = OpExtInst %v3float %11 Trunc %12 - OpStore %res %9 +%trunc_562d05 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %16 + %13 = OpExtInst %v3float %15 Trunc %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %trunc_562d05 + %26 = OpFunctionCall %void %trunc_562d05 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %trunc_562d05 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %trunc_562d05 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %trunc_562d05 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %trunc_562d05 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl index b1b63479e6..577f7a6975 100644 --- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn trunc_562d05() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_562d05(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl index f52677e61f..eaaac11f1f 100644 --- a/test/intrinsics/gen/trunc/e183aa.wgsl +++ b/test/intrinsics/gen/trunc/e183aa.wgsl @@ -27,8 +27,9 @@ fn trunc_e183aa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_e183aa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl index 8f55919f46..c8f325698b 100644 --- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void trunc_e183aa() { float4 res = trunc(float4(0.0f, 0.0f, 0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { trunc_e183aa(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl index 7b480264e0..484423549c 100644 --- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void trunc_e183aa() { float4 res = trunc(float4()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { trunc_e183aa(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm index 01065e1299..fb0d60aaa6 100644 --- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm @@ -1,53 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 32 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %trunc_e183aa "trunc_e183aa" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 - %12 = OpConstantNull %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %_ptr_Function_v4float = OpTypePointer Function %v4float + %17 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%trunc_e183aa = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %12 - %9 = OpExtInst %v4float %11 Trunc %12 - OpStore %res %9 +%trunc_e183aa = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 Trunc %8 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel - OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %trunc_e183aa - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %17 +%tint_symbol = OpFunctionParameter %v4float %20 = OpLabel - %21 = OpFunctionCall %void %trunc_e183aa + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 %24 = OpFunctionCall %void %trunc_e183aa + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %trunc_e183aa + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %trunc_e183aa OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl index f41ba24d98..a2a0db11a9 100644 --- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn trunc_e183aa() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_e183aa(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl index 3487eb3e52..640179d220 100644 --- a/test/intrinsics/gen/trunc/eb83df.wgsl +++ b/test/intrinsics/gen/trunc/eb83df.wgsl @@ -27,8 +27,9 @@ fn trunc_eb83df() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_eb83df(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl index 0dc4fc40aa..d778329e5c 100644 --- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void trunc_eb83df() { float res = trunc(1.0f); } -void vertex_main() { +tint_symbol vertex_main() { trunc_eb83df(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl index 803fea72f6..4e8c7ac560 100644 --- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void trunc_eb83df() { float res = trunc(1.0f); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { trunc_eb83df(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm index 73577d1c0f..f950d5d5f3 100644 --- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm @@ -1,51 +1,67 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 23 +; Bound: 32 ; Schema: 0 OpCapability Shader - %10 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %trunc_eb83df "trunc_eb83df" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %float_1 = OpConstant %float 1 %_ptr_Function_float = OpTypePointer Function %float -%trunc_eb83df = OpFunction %void None %5 - %8 = OpLabel + %18 = OpTypeFunction %void %v4float +%trunc_eb83df = OpFunction %void None %9 + %12 = OpLabel %res = OpVariable %_ptr_Function_float Function %4 - %9 = OpExtInst %float %10 Trunc %float_1 - OpStore %res %9 + %13 = OpExtInst %float %14 Trunc %float_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %15 = OpLabel - OpStore %tint_pointsize %float_1 - %16 = OpFunctionCall %void %trunc_eb83df - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %18 = OpLabel - %19 = OpFunctionCall %void %trunc_eb83df - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %18 +%tint_symbol = OpFunctionParameter %v4float %21 = OpLabel - %22 = OpFunctionCall %void %trunc_eb83df + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %trunc_eb83df + %25 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %trunc_eb83df + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %trunc_eb83df OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl index ebf5104490..2821e14bfc 100644 --- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn trunc_eb83df() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_eb83df(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl index 0a3c51a5d1..3995e1f65c 100644 --- a/test/intrinsics/gen/trunc/f370d3.wgsl +++ b/test/intrinsics/gen/trunc/f370d3.wgsl @@ -27,8 +27,9 @@ fn trunc_f370d3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_f370d3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl index 92854e2ea6..7e1e5324ec 100644 --- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl @@ -1,10 +1,15 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void trunc_f370d3() { float2 res = trunc(float2(0.0f, 0.0f)); } -void vertex_main() { +tint_symbol vertex_main() { trunc_f370d3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl index b5ec5fde0b..2b58e71e7c 100644 --- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void trunc_f370d3() { float2 res = trunc(float2()); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { trunc_f370d3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm index 626914436e..7736f486e1 100644 --- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm @@ -1,53 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 25 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %trunc_f370d3 "trunc_f370d3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 - %12 = OpConstantNull %v2float + %16 = OpConstantNull %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%trunc_f370d3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %12 - %9 = OpExtInst %v2float %11 Trunc %12 - OpStore %res %9 +%trunc_f370d3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %13 = OpExtInst %v2float %15 Trunc %16 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %16 = OpLabel +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float + %22 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel OpStore %tint_pointsize %float_1 - %18 = OpFunctionCall %void %trunc_f370d3 + %26 = OpFunctionCall %void %trunc_f370d3 + %27 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %20 = OpLabel - %21 = OpFunctionCall %void %trunc_f370d3 +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %trunc_f370d3 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %23 = OpLabel - %24 = OpFunctionCall %void %trunc_f370d3 +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %trunc_f370d3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl index 35a6565df7..7b80337d7f 100644 --- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn trunc_f370d3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { trunc_f370d3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl index 93e4b1f094..bcdd9bdc67 100644 --- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl @@ -27,8 +27,9 @@ fn unpack2x16float_32a5cf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack2x16float_32a5cf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl index e675e28d01..ab62075d57 100644 --- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl @@ -1,11 +1,16 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void unpack2x16float_32a5cf() { uint tint_tmp = 1u; float2 res = f16tof32(uint2(tint_tmp & 0xffff, tint_tmp >> 16)); } -void vertex_main() { +tint_symbol vertex_main() { unpack2x16float_32a5cf(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl index 8f4f001717..210f23e8d9 100644 --- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void unpack2x16float_32a5cf() { float2 res = float2(as_type(1u)); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { unpack2x16float_32a5cf(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm index 0b608bacda..f094822663 100644 --- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %unpack2x16float_32a5cf "unpack2x16float_32a5cf" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_v2float = OpTypePointer Function %v2float - %16 = OpConstantNull %v2float + %20 = OpConstantNull %v2float + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%unpack2x16float_32a5cf = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %16 - %9 = OpExtInst %v2float %11 UnpackHalf2x16 %uint_1 - OpStore %res %9 +%unpack2x16float_32a5cf = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %20 + %13 = OpExtInst %v2float %15 UnpackHalf2x16 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %unpack2x16float_32a5cf + %28 = OpFunctionCall %void %unpack2x16float_32a5cf + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %unpack2x16float_32a5cf +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %unpack2x16float_32a5cf OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %unpack2x16float_32a5cf +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %unpack2x16float_32a5cf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl index d310518f14..ac3033fa06 100644 --- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn unpack2x16float_32a5cf() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack2x16float_32a5cf(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl index 548843659b..401820369b 100644 --- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl @@ -27,8 +27,9 @@ fn unpack2x16snorm_b4aea6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack2x16snorm_b4aea6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl index 9a90dc921d..1eb6221e7a 100644 --- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void unpack2x16snorm_b4aea6() { int tint_tmp_1 = int(1u); int2 tint_tmp = int2(tint_tmp_1 << 16, tint_tmp_1) >> 16; float2 res = clamp(float2(tint_tmp) / 32767.0, -1.0, 1.0); } -void vertex_main() { +tint_symbol vertex_main() { unpack2x16snorm_b4aea6(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl index c315dce002..2795c378fd 100644 --- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void unpack2x16snorm_b4aea6() { float2 res = unpack_snorm2x16_to_float(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { unpack2x16snorm_b4aea6(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm index c52f991958..9dcabf8f75 100644 --- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %unpack2x16snorm_b4aea6 "unpack2x16snorm_b4aea6" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_v2float = OpTypePointer Function %v2float - %16 = OpConstantNull %v2float + %20 = OpConstantNull %v2float + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%unpack2x16snorm_b4aea6 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %16 - %9 = OpExtInst %v2float %11 UnpackSnorm2x16 %uint_1 - OpStore %res %9 +%unpack2x16snorm_b4aea6 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %20 + %13 = OpExtInst %v2float %15 UnpackSnorm2x16 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %unpack2x16snorm_b4aea6 + %28 = OpFunctionCall %void %unpack2x16snorm_b4aea6 + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %unpack2x16snorm_b4aea6 +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %unpack2x16snorm_b4aea6 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %unpack2x16snorm_b4aea6 +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %unpack2x16snorm_b4aea6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl index 662770e6cf..149234bdde 100644 --- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn unpack2x16snorm_b4aea6() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack2x16snorm_b4aea6(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl index 4b22886ccf..429164a74a 100644 --- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl @@ -27,8 +27,9 @@ fn unpack2x16unorm_7699c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack2x16unorm_7699c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl index cb6aef9bba..75366ad6c3 100644 --- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void unpack2x16unorm_7699c0() { uint tint_tmp_1 = 1u; uint2 tint_tmp = uint2(tint_tmp_1 & 0xffff, tint_tmp_1 >> 16); float2 res = float2(tint_tmp) / 65535.0; } -void vertex_main() { +tint_symbol vertex_main() { unpack2x16unorm_7699c0(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl index 9d652668f3..706b45e22e 100644 --- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void unpack2x16unorm_7699c0() { float2 res = unpack_unorm2x16_to_float(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { unpack2x16unorm_7699c0(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm index 1df109e9d3..e36eed5b20 100644 --- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm @@ -1,55 +1,71 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 36 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %15 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %unpack2x16unorm_7699c0 "unpack2x16unorm_7699c0" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 %void = OpTypeVoid - %5 = OpTypeFunction %void + %9 = OpTypeFunction %void %v2float = OpTypeVector %float 2 %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_v2float = OpTypePointer Function %v2float - %16 = OpConstantNull %v2float + %20 = OpConstantNull %v2float + %21 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%unpack2x16unorm_7699c0 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v2float Function %16 - %9 = OpExtInst %v2float %11 UnpackUnorm2x16 %uint_1 - OpStore %res %9 +%unpack2x16unorm_7699c0 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %20 + %13 = OpExtInst %v2float %15 UnpackUnorm2x16 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel +%tint_symbol_2 = OpFunction %void None %21 +%tint_symbol = OpFunctionParameter %v4float + %24 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %26 = OpLabel OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %unpack2x16unorm_7699c0 + %28 = OpFunctionCall %void %unpack2x16unorm_7699c0 + %29 = OpFunctionCall %void %tint_symbol_2 %8 OpReturn OpFunctionEnd -%fragment_main = OpFunction %void None %5 - %22 = OpLabel - %23 = OpFunctionCall %void %unpack2x16unorm_7699c0 +%fragment_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %unpack2x16unorm_7699c0 OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel - %26 = OpFunctionCall %void %unpack2x16unorm_7699c0 +%compute_main = OpFunction %void None %9 + %34 = OpLabel + %35 = OpFunctionCall %void %unpack2x16unorm_7699c0 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl index 819996c2a0..547acfe893 100644 --- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn unpack2x16unorm_7699c0() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack2x16unorm_7699c0(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl index 9c703423f2..037cd9ee97 100644 --- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl @@ -27,8 +27,9 @@ fn unpack4x8snorm_523fb3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack4x8snorm_523fb3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl index e9009fca85..06b04ef424 100644 --- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void unpack4x8snorm_523fb3() { int tint_tmp_1 = int(1u); int4 tint_tmp = int4(tint_tmp_1 << 24, tint_tmp_1 << 16, tint_tmp_1 << 8, tint_tmp_1) >> 24; float4 res = clamp(float4(tint_tmp) / 127.0, -1.0, 1.0); } -void vertex_main() { +tint_symbol vertex_main() { unpack4x8snorm_523fb3(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl index 1912c1a5cd..af4fb45ff5 100644 --- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void unpack4x8snorm_523fb3() { float4 res = unpack_snorm4x8_to_float(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { unpack4x8snorm_523fb3(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm index 3fc6309f7f..1b26065371 100644 --- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %unpack4x8snorm_523fb3 "unpack4x8snorm_523fb3" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %16 = OpConstantNull %v4float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%unpack4x8snorm_523fb3 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %16 - %9 = OpExtInst %v4float %11 UnpackSnorm4x8 %uint_1 - OpStore %res %9 +%unpack4x8snorm_523fb3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 UnpackSnorm4x8 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %unpack4x8snorm_523fb3 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %unpack4x8snorm_523fb3 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %unpack4x8snorm_523fb3 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %unpack4x8snorm_523fb3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %unpack4x8snorm_523fb3 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl index 6352fdc782..82992c25c6 100644 --- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn unpack4x8snorm_523fb3() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack4x8snorm_523fb3(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl index 6bab108810..a322d48cf6 100644 --- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl @@ -27,8 +27,9 @@ fn unpack4x8unorm_750c74() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack4x8unorm_750c74(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl index bb4345719e..277b247a9c 100644 --- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl @@ -1,12 +1,17 @@ +struct tint_symbol { + float4 value : SV_Position; +}; + void unpack4x8unorm_750c74() { uint tint_tmp_1 = 1u; uint4 tint_tmp = uint4(tint_tmp_1 & 0xff, (tint_tmp_1 >> 8) & 0xff, (tint_tmp_1 >> 16) & 0xff, tint_tmp_1 >> 24); float4 res = float4(tint_tmp) / 255.0; } -void vertex_main() { +tint_symbol vertex_main() { unpack4x8unorm_750c74(); - return; + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; + return tint_symbol_1; } void fragment_main() { diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl index 9b8a802988..5c4da0d306 100644 --- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl @@ -1,13 +1,18 @@ #include using namespace metal; +struct tint_symbol { + float4 value [[position]]; +}; + void unpack4x8unorm_750c74() { float4 res = unpack_unorm4x8_to_float(1u); } -vertex void vertex_main() { +vertex tint_symbol vertex_main() { unpack4x8unorm_750c74(); - return; + tint_symbol const tint_symbol_1 = {.value=float4()}; + return tint_symbol_1; } fragment void fragment_main() { diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm index 6b420e3d3f..c61f7da24e 100644 --- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm @@ -1,55 +1,69 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 27 +; Bound: 34 ; Schema: 0 OpCapability Shader - %11 = OpExtInstImport "GLSL.std.450" + %14 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint GLCompute %compute_main "compute_main" OpExecutionMode %fragment_main OriginUpperLeft OpExecutionMode %compute_main LocalSize 1 1 1 OpName %tint_pointsize "tint_pointsize" + OpName %tint_symbol_1 "tint_symbol_1" OpName %unpack4x8unorm_750c74 "unpack4x8unorm_750c74" OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" OpName %vertex_main "vertex_main" OpName %fragment_main "fragment_main" OpName %compute_main "compute_main" OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %tint_symbol_1 BuiltIn Position %float = OpTypeFloat 32 %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %void = OpTypeVoid - %5 = OpTypeFunction %void %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %8 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8 + %void = OpTypeVoid + %9 = OpTypeFunction %void %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 %_ptr_Function_v4float = OpTypePointer Function %v4float - %16 = OpConstantNull %v4float + %19 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%unpack4x8unorm_750c74 = OpFunction %void None %5 - %8 = OpLabel - %res = OpVariable %_ptr_Function_v4float Function %16 - %9 = OpExtInst %v4float %11 UnpackUnorm4x8 %uint_1 - OpStore %res %9 +%unpack4x8unorm_750c74 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %13 = OpExtInst %v4float %14 UnpackUnorm4x8 %uint_1 + OpStore %res %13 OpReturn OpFunctionEnd -%vertex_main = OpFunction %void None %5 - %18 = OpLabel - OpStore %tint_pointsize %float_1 - %20 = OpFunctionCall %void %unpack4x8unorm_750c74 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %5 +%tint_symbol_2 = OpFunction %void None %19 +%tint_symbol = OpFunctionParameter %v4float %22 = OpLabel - %23 = OpFunctionCall %void %unpack4x8unorm_750c74 + OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd -%compute_main = OpFunction %void None %5 - %25 = OpLabel +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 %26 = OpFunctionCall %void %unpack4x8unorm_750c74 + %27 = OpFunctionCall %void %tint_symbol_2 %8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %unpack4x8unorm_750c74 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %32 = OpLabel + %33 = OpFunctionCall %void %unpack4x8unorm_750c74 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl index 53e09726cb..b41d1ca36d 100644 --- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl @@ -3,8 +3,9 @@ fn unpack4x8unorm_750c74() { } [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { unpack4x8unorm_750c74(); + return vec4(); } [[stage(fragment)]] diff --git a/test/intrinsics/intrinsics.wgsl.tmpl b/test/intrinsics/intrinsics.wgsl.tmpl index c23515fdcf..e0ca593102 100644 --- a/test/intrinsics/intrinsics.wgsl.tmpl +++ b/test/intrinsics/intrinsics.wgsl.tmpl @@ -85,8 +85,9 @@ fn {{$permutation}}() { {{- if .CanBeUsedInStage.Vertex }} [[stage(vertex)]] -fn vertex_main() { +fn vertex_main() -> [[builtin(position)]] vec4 { {{$permutation}}(); + return vec4(); } {{ end -}} diff --git a/tools/check-spec-examples/main.go b/tools/check-spec-examples/main.go index f3263e73a9..944b28ba9f 100644 --- a/tools/check-spec-examples/main.go +++ b/tools/check-spec-examples/main.go @@ -199,7 +199,7 @@ type example struct { func tryCompile(compiler, wd string, e example) error { code := e.code if e.functionScope { - code = "\n[[stage(vertex)]] fn main() {\n" + code + "}\n" + code = "\n[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4 {\n" + code + " return vec4();}\n" } addedStubFunction := false