mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
test(wgsl): check that vec3
args. are accepted in cross
built-in
This commit is contained in:
parent
aadca17885
commit
327b92e92b
3
naga/tests/in/cross.wgsl
Normal file
3
naga/tests/in/cross.wgsl
Normal file
@ -0,0 +1,3 @@
|
||||
@compute @workgroup_size(1) fn main() {
|
||||
let a = cross(vec3(0., 1., 2.), vec3(0., 1., 2.));
|
||||
}
|
12
naga/tests/out/glsl/cross.main.Compute.glsl
Normal file
12
naga/tests/out/glsl/cross.main.Compute.glsl
Normal file
@ -0,0 +1,12 @@
|
||||
#version 310 es
|
||||
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
|
||||
void main() {
|
||||
vec3 a = cross(vec3(0.0, 1.0, 2.0), vec3(0.0, 1.0, 2.0));
|
||||
}
|
||||
|
5
naga/tests/out/hlsl/cross.hlsl
Normal file
5
naga/tests/out/hlsl/cross.hlsl
Normal file
@ -0,0 +1,5 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
float3 a = cross(float3(0.0, 1.0, 2.0), float3(0.0, 1.0, 2.0));
|
||||
}
|
12
naga/tests/out/hlsl/cross.ron
Normal file
12
naga/tests/out/hlsl/cross.ron
Normal file
@ -0,0 +1,12 @@
|
||||
(
|
||||
vertex:[
|
||||
],
|
||||
fragment:[
|
||||
],
|
||||
compute:[
|
||||
(
|
||||
entry_point:"main",
|
||||
target_profile:"cs_5_1",
|
||||
),
|
||||
],
|
||||
)
|
11
naga/tests/out/msl/cross.msl
Normal file
11
naga/tests/out/msl/cross.msl
Normal file
@ -0,0 +1,11 @@
|
||||
// language: metal1.0
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using metal::uint;
|
||||
|
||||
|
||||
kernel void main_(
|
||||
) {
|
||||
metal::float3 a = metal::cross(metal::float3(0.0, 1.0, 2.0), metal::float3(0.0, 1.0, 2.0));
|
||||
}
|
24
naga/tests/out/spv/cross.spvasm
Normal file
24
naga/tests/out/spv/cross.spvasm
Normal file
@ -0,0 +1,24 @@
|
||||
; SPIR-V
|
||||
; Version: 1.1
|
||||
; Generator: rspirv
|
||||
; Bound: 14
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %6 "main"
|
||||
OpExecutionMode %6 LocalSize 1 1 1
|
||||
%2 = OpTypeVoid
|
||||
%4 = OpTypeFloat 32
|
||||
%3 = OpTypeVector %4 3
|
||||
%7 = OpTypeFunction %2
|
||||
%8 = OpConstant %4 0.0
|
||||
%9 = OpConstant %4 1.0
|
||||
%10 = OpConstant %4 2.0
|
||||
%11 = OpConstantComposite %3 %8 %9 %10
|
||||
%6 = OpFunction %2 None %7
|
||||
%5 = OpLabel
|
||||
OpBranch %12
|
||||
%12 = OpLabel
|
||||
%13 = OpExtInst %3 %1 Cross %11 %11
|
||||
OpReturn
|
||||
OpFunctionEnd
|
4
naga/tests/out/wgsl/cross.wgsl
Normal file
4
naga/tests/out/wgsl/cross.wgsl
Normal file
@ -0,0 +1,4 @@
|
||||
@compute @workgroup_size(1, 1, 1)
|
||||
fn main() {
|
||||
let a = cross(vec3<f32>(0f, 1f, 2f), vec3<f32>(0f, 1f, 2f));
|
||||
}
|
@ -910,6 +910,10 @@ fn convert_wgsl() {
|
||||
Targets::IR | Targets::SPIRV | Targets::METAL,
|
||||
),
|
||||
("vertex-pulling-transform", Targets::METAL),
|
||||
(
|
||||
"cross",
|
||||
Targets::SPIRV | Targets::METAL | Targets::GLSL | Targets::HLSL | Targets::WGSL,
|
||||
),
|
||||
];
|
||||
|
||||
for &(name, targets) in inputs.iter() {
|
||||
|
Loading…
Reference in New Issue
Block a user