Skip to content
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
4 changes: 4 additions & 0 deletions crates/xcl/src/shaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,8 @@ mod pipeline_cap_tests {
fn stale_blob_cannot_bypass_the_offline_pipeline_cap() {
use super::{Pipelines, recomp, Ordering};
use std::time::{Instant, SystemTime, UNIX_EPOCH};
// Pipelines::make* stores into the process-wide library builder that the library tests begin.
let _serial = crate::shaders::pipeline_library::BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());

struct Scratch(std::path::PathBuf);
impl Drop for Scratch {
Expand Down Expand Up @@ -1992,6 +1994,7 @@ mod pipeline_cap_tests {
use std::sync::Arc;
use std::time::{SystemTime, UNIX_EPOCH};
use windows::Win32::Graphics::Direct3D12::*;
let _serial = crate::shaders::pipeline_library::BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());

struct Scratch(std::path::PathBuf);
impl Drop for Scratch {
Expand Down Expand Up @@ -4386,6 +4389,7 @@ mod tests {
recomp::runner::skip_test(&e);
return;
}
let _serial = crate::shaders::pipeline_library::BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());
struct Temp(std::path::PathBuf);
impl Drop for Temp {
fn drop(&mut self) {
Expand Down
6 changes: 3 additions & 3 deletions crates/xcl/src/shaders/pipeline_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void main() {{ output.Store(0, {n}); }}

#[test]
fn builder_deduplicates_names_and_atomically_replaces_output() {
let _serial = BUILD_TEST.lock().unwrap();
let _serial = BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());
let Some((pipelines, dxil, root)) = fixture() else { return };
let desc = compute_desc(&dxil, &root);
let pso = unsafe { pipelines.dev.CreateComputePipelineState::<ID3D12PipelineState>(&desc) }
Expand Down Expand Up @@ -426,7 +426,7 @@ void main() {{ output.Store(0, {n}); }}

#[test]
fn graphics_pipeline_round_trips_through_serialized_library() {
let _serial = BUILD_TEST.lock().unwrap();
let _serial = BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());
let Some((pipelines, _, _)) = fixture() else { return };
let source = r#"
#define RS ""
Expand Down Expand Up @@ -490,7 +490,7 @@ struct V { float4 p : SV_Position; };

#[test]
fn mesh_pipeline_round_trips_through_serialized_library() {
let _serial = BUILD_TEST.lock().unwrap();
let _serial = BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());
let Some((pipelines, _, _)) = fixture() else { return };
let mut options = D3D12_FEATURE_DATA_D3D12_OPTIONS7::default();
if unsafe {
Expand Down
2 changes: 1 addition & 1 deletion crates/xcl/src/shaders/warm_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ mod tests {
..Default::default()
};
let pso = unsafe { pipelines.dev.CreateComputePipelineState::<ID3D12PipelineState>(&desc) }.unwrap();
let _serial = super::super::pipeline_library::BUILD_TEST.lock().unwrap();
let _serial = super::super::pipeline_library::BUILD_TEST.lock().unwrap_or_else(|e| e.into_inner());
super::super::pipeline_library::abort();
assert!(super::super::pipeline_library::begin(&pipelines.dev, None).unwrap());
super::super::pipeline_library::store("fixture.pso".into(), &pso).unwrap();
Expand Down
Loading