mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 06:03:34 +00:00
The resolver now wraps sem::Expression objects with a sem::Load object anywhere that the load rule is invoked. sem::Expression provides an `UnwrapLoad()` method that returns the inner expression (or passthrough, if no load is present), which is analaguous to Type::UnwrapRef(). The logic for alias analysis in `RegisterLoadIfNeeded` has been folded into the new `Resolver::Load` method. Fixed up many transforms and tests. The only difference in output is for a single SPIR-V backend test, where some IDs have changed due to slight re-ordering of when expressions are generated. There may be further clean-ups possible (e.g. removing unnecessary calls to `UnwrapRef`, and simplifying places in the SPIR-V writer or transforms that deal with memory accesses), but these can be addressed in future patches. Fixed: tint:1654 Change-Id: I69adecfe9251faae46546b64d0cdc29eea26cd4e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99706 Commit-Queue: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.3
|
|
; Generator: Google Tint Compiler; 0
|
|
; Bound: 20
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %main "main"
|
|
OpExecutionMode %main LocalSize 1 1 1
|
|
OpName %main "main"
|
|
OpName %v "v"
|
|
%void = OpTypeVoid
|
|
%1 = OpTypeFunction %void
|
|
%float = OpTypeFloat 32
|
|
%v3float = OpTypeVector %float 3
|
|
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
|
%9 = OpConstantNull %v3float
|
|
%uint = OpTypeInt 32 0
|
|
%uint_1 = OpConstant %uint 1
|
|
%_ptr_Function_float = OpTypePointer Function %float
|
|
%v2float = OpTypeVector %float 2
|
|
%main = OpFunction %void None %1
|
|
%4 = OpLabel
|
|
%v = OpVariable %_ptr_Function_v3float Function %9
|
|
%13 = OpAccessChain %_ptr_Function_float %v %uint_1
|
|
%14 = OpLoad %float %13
|
|
%15 = OpLoad %v3float %v
|
|
%17 = OpVectorShuffle %v2float %15 %15 0 2
|
|
%18 = OpLoad %v3float %v
|
|
%19 = OpVectorShuffle %v3float %18 %18 0 2 1
|
|
OpReturn
|
|
OpFunctionEnd
|