-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
unpack4x{I,U}8
output exprs. composable in `{hlsl,msl}-ou…
…t` (#6773)
- Loading branch information
1 parent
ee3ae0e
commit 9d9b99a
Showing
13 changed files
with
108 additions
and
6 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
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,2 @@ | ||
( | ||
) |
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,6 @@ | ||
@compute @workgroup_size(1, 1) | ||
fn main() { | ||
let idx = 2; | ||
_ = unpack4xI8(12u)[idx]; | ||
_ = unpack4xU8(12u)[1]; | ||
} |
13 changes: 13 additions & 0 deletions
13
naga/tests/out/glsl/6772-unpack-expr-accesses.main.Compute.glsl
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,13 @@ | ||
#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() { | ||
int phony = ivec4(bitfieldExtract(int(12u), 0, 8), bitfieldExtract(int(12u), 8, 8), bitfieldExtract(int(12u), 16, 8), bitfieldExtract(int(12u), 24, 8))[2]; | ||
uint phony_1 = uvec4(bitfieldExtract(12u, 0, 8), bitfieldExtract(12u, 8, 8), bitfieldExtract(12u, 16, 8), bitfieldExtract(12u, 24, 8)).y; | ||
} | ||
|
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,6 @@ | ||
[numthreads(1, 1, 1)] | ||
void main() | ||
{ | ||
int phony = (int4(12u, 12u >> 8, 12u >> 16, 12u >> 24) << 24 >> 24)[2]; | ||
uint phony_1 = (uint4(12u, 12u >> 8, 12u >> 16, 12u >> 24) << 24 >> 24).y; | ||
} |
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
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 @@ | ||
// language: metal1.0 | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using metal::uint; | ||
|
||
|
||
kernel void main_( | ||
) { | ||
int phony = (int4(12u, 12u >> 8, 12u >> 16, 12u >> 24) << 24 >> 24)[2]; | ||
uint phony_1 = (uint4(12u, 12u >> 8, 12u >> 16, 12u >> 24) << 24 >> 24).y; | ||
} |
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,40 @@ | ||
; SPIR-V | ||
; Version: 1.1 | ||
; Generator: rspirv | ||
; Bound: 30 | ||
OpCapability Shader | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint GLCompute %4 "main" | ||
OpExecutionMode %4 LocalSize 1 1 1 | ||
%2 = OpTypeVoid | ||
%5 = OpTypeFunction %2 | ||
%6 = OpTypeInt 32 1 | ||
%7 = OpConstant %6 2 | ||
%8 = OpTypeInt 32 0 | ||
%9 = OpConstant %8 12 | ||
%11 = OpTypeVector %6 4 | ||
%13 = OpConstant %8 8 | ||
%19 = OpConstant %8 0 | ||
%20 = OpConstant %8 16 | ||
%21 = OpConstant %8 24 | ||
%23 = OpTypeVector %8 4 | ||
%4 = OpFunction %2 None %5 | ||
%3 = OpLabel | ||
OpBranch %10 | ||
%10 = OpLabel | ||
%14 = OpBitcast %6 %9 | ||
%15 = OpBitFieldSExtract %6 %14 %19 %13 | ||
%16 = OpBitFieldSExtract %6 %14 %13 %13 | ||
%17 = OpBitFieldSExtract %6 %14 %20 %13 | ||
%18 = OpBitFieldSExtract %6 %14 %21 %13 | ||
%12 = OpCompositeConstruct %11 %15 %16 %17 %18 | ||
%22 = OpCompositeExtract %6 %12 2 | ||
%25 = OpBitFieldUExtract %8 %9 %19 %13 | ||
%26 = OpBitFieldUExtract %8 %9 %13 %13 | ||
%27 = OpBitFieldUExtract %8 %9 %20 %13 | ||
%28 = OpBitFieldUExtract %8 %9 %21 %13 | ||
%24 = OpCompositeConstruct %23 %25 %26 %27 %28 | ||
%29 = OpCompositeExtract %8 %24 1 | ||
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,5 @@ | ||
@compute @workgroup_size(1, 1, 1) | ||
fn main() { | ||
let phony = unpack4xI8(12u)[2i]; | ||
let phony_1 = unpack4xU8(12u).y; | ||
} |
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