Skip to content

Commit 7ff8b9d

Browse files
committed
Update feature docs and test expectations for pure Rust spirv-tools
Update Cargo.toml feature documentation: - The use-compiled-tools and use-installed-tools features are now no-ops since we use a pure Rust implementation of spirv-tools - Keep features for backward compatibility with existing build configurations - Fix typo: rustc_cogeden_spirv → rustc_codegen_spirv Update test expectations: - explicit_overlap.stderr: Now shows rich error with source spans - mesh_shader.stderr: NV suffixes updated to EXT (OutputPrimitivesNV → OutputPrimitivesEXT, etc.) - member_ref_arg-broken: Updated line numbers and add normalizer for new error format
1 parent f5eca7c commit 7ff8b9d

6 files changed

Lines changed: 27 additions & 28 deletions

File tree

crates/rustc_codegen_spirv/Cargo.toml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,11 @@ repository.workspace = true
1212
crate-type = ["dylib"]
1313

1414
[features]
15-
# By default, the use-compiled-tools is enabled, as doesn't require additional
16-
# setup steps for the user. This does however mean that you will need to disable
17-
# default features and explicitly enable `use-installed-tools` if you are using
18-
# this in an environment with spirv-tools in PATH, and you don't want to take
19-
# the compile time cost
20-
default = ["use-compiled-tools"]
21-
# If enabled, uses spirv-tools binaries installed in PATH, instead of
22-
# compiling and linking the spirv-tools C++ code
23-
use-installed-tools = ["spirv-tools/use-installed-tools"]
24-
# If enabled will compile and link the C++ code for the spirv tools, the compiled
25-
# version is preferred if both this and `use-installed-tools` are enabled
26-
use-compiled-tools = ["spirv-tools/use-compiled-tools"]
15+
# These features are no-ops kept for compatibility with existing build configurations.
16+
use-installed-tools = []
17+
use-compiled-tools = []
2718
# If enabled, this will not check whether the current rustc version is set to the
28-
# appropriate channel. rustc_cogeden_spirv requires a specific nightly version,
19+
# appropriate channel. rustc_codegen_spirv requires a specific nightly version,
2920
# and will likely produce compile errors when built against a different toolchain.
3021
# Enable this feature to be able to experiment with other versions.
3122
skip-toolchain-check = []

tests/compiletests/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ edition.workspace = true
77
license.workspace = true
88
repository.workspace = true
99

10-
# See rustc_codegen_spirv/Cargo.toml for details on these features
1110
[features]
12-
default = ["use-compiled-tools"]
13-
use-installed-tools = ["rustc_codegen_spirv/use-installed-tools"]
14-
use-compiled-tools = ["rustc_codegen_spirv/use-compiled-tools"]
11+
# These features are no-ops kept for compatibility with existing build configurations.
12+
use-installed-tools = []
13+
use-compiled-tools = []
1514

1615
[dependencies]
1716
compiletest = { version = "0.11.2", package = "compiletest_rs" }

tests/compiletests/ui/lang/core/ref/member_ref_arg-broken.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// build-fail
66
// normalize-stderr-test "ref/member_ref_arg-broken\.[^`]*" -> "ref/member_ref_arg-broken"
77
// normalize-stderr-test "38\[%38\]" -> "$$ID[%$$ID]"
8+
// normalize-stderr-test "'38'" -> "'$$ID[%$$ID]'"
89

910
use spirv_std::spirv;
1011

tests/compiletests/ui/lang/core/ref/member_ref_arg-broken.stderr

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: `#[inline(never)]` function `member_ref_arg_broken::f` has been inlined
2-
--> $DIR/member_ref_arg-broken.rs:20:4
2+
--> $DIR/member_ref_arg-broken.rs:21:4
33
|
44
LL | fn f(x: &u32) -> u32 {
55
| ^
@@ -8,7 +8,7 @@ LL | fn f(x: &u32) -> u32 {
88
= note: called from `member_ref_arg_broken::main`
99

1010
warning: `#[inline(never)]` function `member_ref_arg_broken::g` has been inlined
11-
--> $DIR/member_ref_arg-broken.rs:25:4
11+
--> $DIR/member_ref_arg-broken.rs:26:4
1212
|
1313
LL | fn g(xy: (&u32, &u32)) -> (u32, u32) {
1414
| ^
@@ -17,7 +17,7 @@ LL | fn g(xy: (&u32, &u32)) -> (u32, u32) {
1717
= note: called from `member_ref_arg_broken::main`
1818

1919
warning: `#[inline(never)]` function `member_ref_arg_broken::h` has been inlined
20-
--> $DIR/member_ref_arg-broken.rs:30:4
20+
--> $DIR/member_ref_arg-broken.rs:31:4
2121
|
2222
LL | fn h(xyz: (&u32, &u32, &u32)) -> (u32, u32, u32) {
2323
| ^
@@ -26,7 +26,7 @@ LL | fn h(xyz: (&u32, &u32, &u32)) -> (u32, u32, u32) {
2626
= note: called from `member_ref_arg_broken::main`
2727

2828
warning: `#[inline(never)]` function `member_ref_arg_broken::h_newtyped` has been inlined
29-
--> $DIR/member_ref_arg-broken.rs:41:4
29+
--> $DIR/member_ref_arg-broken.rs:42:4
3030
|
3131
LL | fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) {
3232
| ^^^^^^^^^^
@@ -35,7 +35,6 @@ LL | fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) {
3535
= note: called from `member_ref_arg_broken::main`
3636

3737
error: error:0:0 - OpLoad Pointer <id> '$ID[%$ID]' is not a logical pointer.
38-
%39 = OpLoad %uint %38
3938
|
4039
= note: spirv-val failed
4140
= note: module `$TEST_BUILD_DIR/lang/core/ref/member_ref_arg-broken`

tests/compiletests/ui/spirv-attr/location_assignment/explicit_overlap.stderr

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,18 @@ OpStore %26 %14
4141
OpNoLine
4242
OpReturn
4343
OpFunctionEnd
44-
error: error:0:0 - [VUID-StandaloneSpirv-OpEntryPoint-08722] Entry-point has conflicting output location assignment at location 1, component 0
45-
OpEntryPoint Vertex %1 "main" %out1 %out2
44+
error: Output variable `out2` at location 1 conflicts with another variable
45+
--> $DIR/explicit_overlap.rs:24:53
4646
|
47+
LL | pub fn main(#[spirv(location = 0)] out1: &mut Mat4, #[spirv(location = 1)] out2: &mut Vec2) {
48+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49+
|
50+
note: variable `out1` already uses location 1 component 0
51+
--> $DIR/explicit_overlap.rs:24:13
52+
|
53+
LL | pub fn main(#[spirv(location = 0)] out1: &mut Mat4, #[spirv(location = 1)] out2: &mut Vec2) {
54+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
= help: `out1` is at location 0 but type `spirv_std::glam::Mat4` consumes 4 locations (0–3)
4756
= note: spirv-val failed
4857
= note: module `<normalized>`
4958

tests/compiletests/ui/spirv-attr/location_assignment/mesh_shader.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ OpMemoryModel Logical Simple
55
OpEntryPoint MeshEXT %1 "main" %2 %3 %4 %5 %6 %7
66
OpExecutionMode %1 LocalSize 1 1 1
77
OpExecutionMode %1 OutputVertices 9
8-
OpExecutionMode %1 OutputPrimitivesNV 3
9-
OpExecutionMode %1 OutputTrianglesNV
8+
OpExecutionMode %1 OutputPrimitivesEXT 3
9+
OpExecutionMode %1 OutputTrianglesEXT
1010
OpName %16 "core::ops::Range<usize>"
1111
OpMemberName %16 0 "start"
1212
OpMemberName %16 1 "end"
@@ -23,9 +23,9 @@ OpDecorate %3 Location 0
2323
OpDecorate %4 Location 1
2424
OpDecorate %5 BuiltIn PrimitiveTriangleIndicesEXT
2525
OpDecorate %6 Location 2
26-
OpDecorate %6 PerPrimitiveNV
26+
OpDecorate %6 PerPrimitiveEXT
2727
OpDecorate %7 Location 3
28-
OpDecorate %7 PerPrimitiveNV
28+
OpDecorate %7 PerPrimitiveEXT
2929
%17 = OpTypeFloat 32
3030
%18 = OpTypeVector %17 4
3131
%19 = OpTypeInt 32 0

0 commit comments

Comments
 (0)