Ben Clayton fe08ba4677 builtins: Add insertBits
CTS tests: https://github.com/gpuweb/cts/pull/1012

Bug: tint:1371
Change-Id: Idd55c0bc9dad1dffb558d0bc57d744f65e9041b5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81701
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2022-02-23 21:18:09 +00:00

35 lines
1.5 KiB
Plaintext

OpCapability Shader
%17 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %f "f"
OpName %v "v"
OpName %n "n"
OpName %offset "offset"
OpName %count "count"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
%9 = OpConstantNull %v3int
%uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
%14 = OpConstantNull %uint
%uint_31 = OpConstant %uint 31
%uint_32 = OpConstant %uint 32
%f = OpFunction %void None %1
%4 = OpLabel
%v = OpVariable %_ptr_Function_v3int Function %9
%n = OpVariable %_ptr_Function_v3int Function %9
%offset = OpVariable %_ptr_Function_uint Function %14
%count = OpVariable %_ptr_Function_uint Function %14
%18 = OpLoad %v3int %v
%19 = OpLoad %v3int %n
%20 = OpLoad %uint %offset
%21 = OpLoad %uint %count
%16 = OpBitFieldInsert %v3int %18 %19 %20 %21
OpReturn
OpFunctionEnd