-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ConstantEvaluator::swizzle: Handle vector concatenation.
- Loading branch information
Showing
9 changed files
with
187 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@group(0) @binding(0) | ||
var<storage, read_write> out: vec4<i32>; | ||
|
||
@compute @workgroup_size(1) | ||
fn main() { | ||
let a = vec2(1, 2); | ||
let b = vec2(3, 4); | ||
out = vec4(a, b).wzyx; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#version 310 es | ||
|
||
precision highp float; | ||
precision highp int; | ||
|
||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
layout(std430) buffer type_block_0Compute { ivec4 _group_0_binding_0_cs; }; | ||
|
||
|
||
void main() { | ||
ivec2 a = ivec2(1, 2); | ||
ivec2 b = ivec2(3, 4); | ||
_group_0_binding_0_cs = ivec4(4, 3, 2, 1); | ||
return; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
RWByteAddressBuffer out_ : register(u0); | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() | ||
{ | ||
int2 a = int2(1, 2); | ||
int2 b = int2(3, 4); | ||
out_.Store4(0, asuint(int4(4, 3, 2, 1))); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
( | ||
vertex:[ | ||
], | ||
fragment:[ | ||
], | ||
compute:[ | ||
( | ||
entry_point:"main", | ||
target_profile:"cs_5_1", | ||
), | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// language: metal2.0 | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using metal::uint; | ||
|
||
|
||
kernel void main_( | ||
device metal::int4& out [[user(fake0)]] | ||
) { | ||
metal::int2 a = metal::int2(1, 2); | ||
metal::int2 b = metal::int2(3, 4); | ||
out = metal::int4(4, 3, 2, 1); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
; SPIR-V | ||
; Version: 1.1 | ||
; Generator: rspirv | ||
; Bound: 25 | ||
OpCapability Shader | ||
OpExtension "SPV_KHR_storage_buffer_storage_class" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint GLCompute %12 "main" | ||
OpExecutionMode %12 LocalSize 1 1 1 | ||
OpDecorate %8 DescriptorSet 0 | ||
OpDecorate %8 Binding 0 | ||
OpDecorate %9 Block | ||
OpMemberDecorate %9 0 Offset 0 | ||
%2 = OpTypeVoid | ||
%4 = OpTypeInt 32 1 | ||
%3 = OpTypeVector %4 4 | ||
%5 = OpTypeVector %4 2 | ||
%6 = OpConstant %4 0 | ||
%7 = OpConstant %4 1 | ||
%9 = OpTypeStruct %3 | ||
%10 = OpTypePointer StorageBuffer %9 | ||
%8 = OpVariable %10 StorageBuffer | ||
%13 = OpTypeFunction %2 | ||
%14 = OpTypePointer StorageBuffer %3 | ||
%16 = OpTypeInt 32 0 | ||
%15 = OpConstant %16 0 | ||
%18 = OpConstant %4 2 | ||
%19 = OpConstantComposite %5 %7 %18 | ||
%20 = OpConstant %4 3 | ||
%21 = OpConstant %4 4 | ||
%22 = OpConstantComposite %5 %20 %21 | ||
%23 = OpConstantComposite %3 %21 %20 %18 %7 | ||
%12 = OpFunction %2 None %13 | ||
%11 = OpLabel | ||
%17 = OpAccessChain %14 %8 %15 | ||
OpBranch %24 | ||
%24 = OpLabel | ||
OpStore %17 %23 | ||
OpReturn | ||
OpFunctionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@group(0) @binding(0) | ||
var<storage, read_write> out: vec4<i32>; | ||
|
||
@compute @workgroup_size(1, 1, 1) | ||
fn main() { | ||
let a = vec2<i32>(1, 2); | ||
let b = vec2<i32>(3, 4); | ||
out = vec4<i32>(4, 3, 2, 1); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters