mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 14:08:04 +00:00
test: Split binary_expressions into separate tests
Tests should be as fine-grained as possible. Not all the permutations were covered. Not all the backends were actually generating anything useful, as the functions were not called by an entry point. Change-Id: I76658533d3112d202f7482a19531079550e66f83 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58392 Auto-Submit: Ben Clayton <bclayton@google.com> Commit-Queue: David Neto <dneto@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
8f144a09f6
commit
b85099ae73
6
test/expressions/binary/mul/mat4x2-mat2x4/f32.wgsl
Normal file
6
test/expressions/binary/mul/mat4x2-mat2x4/f32.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn f() {
|
||||
let a = mat4x2<f32>(vec2<f32>(-1., -2.), vec2<f32>(-3., -4.), vec2<f32>(-5., -6.), vec2<f32>(-7., -8.));
|
||||
let b = mat2x4<f32>(vec4<f32>(1., 2., 3., 4.), vec4<f32>(5., 6., 7., 8.));
|
||||
let r : mat2x2<f32> = a * b;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
const float4x2 a = float4x2(float2(-1.0f, -2.0f), float2(-3.0f, -4.0f), float2(-5.0f, -6.0f), float2(-7.0f, -8.0f));
|
||||
const float2x4 b = float2x4(float4(1.0f, 2.0f, 3.0f, 4.0f), float4(5.0f, 6.0f, 7.0f, 8.0f));
|
||||
const float2x2 r = mul(b, a);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void f() {
|
||||
float4x2 const a = float4x2(float2(-1.0f, -2.0f), float2(-3.0f, -4.0f), float2(-5.0f, -6.0f), float2(-7.0f, -8.0f));
|
||||
float2x4 const b = float2x4(float4(1.0f, 2.0f, 3.0f, 4.0f), float4(5.0f, 6.0f, 7.0f, 8.0f));
|
||||
float2x2 const r = (a * b);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %f "f"
|
||||
OpExecutionMode %f LocalSize 1 1 1
|
||||
OpName %f "f"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%mat4v2float = OpTypeMatrix %v2float 4
|
||||
%float_n1 = OpConstant %float -1
|
||||
%float_n2 = OpConstant %float -2
|
||||
%10 = OpConstantComposite %v2float %float_n1 %float_n2
|
||||
%float_n3 = OpConstant %float -3
|
||||
%float_n4 = OpConstant %float -4
|
||||
%13 = OpConstantComposite %v2float %float_n3 %float_n4
|
||||
%float_n5 = OpConstant %float -5
|
||||
%float_n6 = OpConstant %float -6
|
||||
%16 = OpConstantComposite %v2float %float_n5 %float_n6
|
||||
%float_n7 = OpConstant %float -7
|
||||
%float_n8 = OpConstant %float -8
|
||||
%19 = OpConstantComposite %v2float %float_n7 %float_n8
|
||||
%20 = OpConstantComposite %mat4v2float %10 %13 %16 %19
|
||||
%v4float = OpTypeVector %float 4
|
||||
%mat2v4float = OpTypeMatrix %v4float 2
|
||||
%float_1 = OpConstant %float 1
|
||||
%float_2 = OpConstant %float 2
|
||||
%float_3 = OpConstant %float 3
|
||||
%float_4 = OpConstant %float 4
|
||||
%27 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
|
||||
%float_5 = OpConstant %float 5
|
||||
%float_6 = OpConstant %float 6
|
||||
%float_7 = OpConstant %float 7
|
||||
%float_8 = OpConstant %float 8
|
||||
%32 = OpConstantComposite %v4float %float_5 %float_6 %float_7 %float_8
|
||||
%33 = OpConstantComposite %mat2v4float %27 %32
|
||||
%mat2v2float = OpTypeMatrix %v2float 2
|
||||
%f = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%34 = OpMatrixTimesMatrix %mat2v2float %20 %33
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn f() {
|
||||
let a = mat4x2<f32>(vec2<f32>(-1.0, -2.0), vec2<f32>(-3.0, -4.0), vec2<f32>(-5.0, -6.0), vec2<f32>(-7.0, -8.0));
|
||||
let b = mat2x4<f32>(vec4<f32>(1.0, 2.0, 3.0, 4.0), vec4<f32>(5.0, 6.0, 7.0, 8.0));
|
||||
let r : mat2x2<f32> = (a * b);
|
||||
}
|
||||
Reference in New Issue
Block a user