Skip to content

Make read_clock_khr always available #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions crates/spirv-std/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ pub fn kill() -> ! {
///
/// See:
/// <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_shader_clock.html>
#[cfg(all(
target_feature = "Int64",
target_feature = "ShaderClockKHR",
target_feature = "ext:SPV_KHR_shader_clock"
))]
#[spirv_std_macros::gpu_only]
#[doc(alias = "OpReadClockKHR")]
pub unsafe fn read_clock_khr<const SCOPE: u32>() -> u64 {
Expand All @@ -172,10 +167,6 @@ pub unsafe fn read_clock_khr<const SCOPE: u32>() -> u64 {
/// capability. It returns a 'vector of two-components of 32-bit unsigned
/// integer type with the first component containing the 32 least significant
/// bits and the second component containing the 32 most significant bits.'
#[cfg(all(
target_feature = "ShaderClockKHR",
target_feature = "ext:SPV_KHR_shader_clock"
))]
#[spirv_std_macros::gpu_only]
#[doc(alias = "OpReadClockKHR")]
pub unsafe fn read_clock_uvec2_khr<V: Vector<u32, 2>, const SCOPE: u32>() -> V {
Expand Down
12 changes: 3 additions & 9 deletions tests/compiletests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ impl Runner {
format!("{}-{}", env, variation.name)
};

println!("Testing env: {}\n", stage_id);

let target = format!("{SPIRV_TARGET_PREFIX}{env}");
let libs = build_deps(&self.deps_target_dir, &self.codegen_backend_path, &target);
let mut flags = test_rustc_flags(&self.codegen_backend_path, &libs, &[
Expand Down Expand Up @@ -342,15 +344,7 @@ struct TestDeps {
/// The RUSTFLAGS passed to all SPIR-V builds.
// FIXME(eddyb) expose most of these from `spirv-builder`.
fn rust_flags(codegen_backend_path: &Path) -> String {
let target_features = [
"Int8",
"Int16",
"Int64",
"Float64",
// Only needed for `ui/arch/read_clock_khr.rs`.
"ShaderClockKHR",
"ext:SPV_KHR_shader_clock",
];
let target_features = ["Int8", "Int16", "Int64", "Float64"];

[
&*format!("-Zcodegen-backend={}", codegen_backend_path.display()),
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/asm_op_decorate.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpCapability RuntimeDescriptorArray
OpExtension "SPV_EXT_descriptor_indexing"
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/const-float-cast-optimized.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
OpCapability Shader
OpCapability Float64
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/const-float-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
OpCapability Shader
OpCapability Float64
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/const-from-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/const-int-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/const-narrowing-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
OpCapability Shader
OpCapability Int8
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/custom_entry_point.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "hello_world"
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/generic-fn-op-name.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/issue-723-output.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_non_semantic_info"
OpExtension "SPV_KHR_shader_clock"
%1 = OpExtInstImport "NonSemantic.DebugPrintf"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %2 "main"
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/panic_sequential_many.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_non_semantic_info"
OpExtension "SPV_KHR_shader_clock"
%1 = OpExtInstImport "NonSemantic.DebugPrintf"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %2 "main" %3 %4 %5
Expand Down
5 changes: 0 additions & 5 deletions tests/compiletests/ui/dis/spec_constant-attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
// normalize-stderr-test "OpExtension .SPV_KHR_vulkan_memory_model.\n" -> ""
// normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple"

// FIXME(eddyb) this should use revisions to track both the `vulkan1.2` output
// and the pre-`vulkan1.2` output, but per-revisions `{only,ignore}-*` directives
// are not supported in `compiletest-rs`.
// ignore-vulkan1.2

use spirv_std::spirv;

#[spirv(fragment)]
Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/dis/spec_constant-attr.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
OpCapability Shader
OpCapability ShaderClockKHR
OpExtension "SPV_KHR_shader_clock"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main" %2
OpExecutionMode %1 OriginUpperLeft
Expand Down