Skip to content
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

snapshots: Consolidate path handling. #2501

Merged
merged 6 commits into from
Sep 25, 2023
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
8 changes: 1 addition & 7 deletions cli/src/bin/naga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
.set(naga::back::spv::WriterFlags::DEBUG, true);
params.spv_out.debug_info = Some(naga::back::spv::DebugInfo {
source_code: input_text,
file_name: input_path
.file_name()
.and_then(std::ffi::OsStr::to_str)
.ok_or(CliError(
"input path for couldn't be converted to string \
for `--generate-debug-symbols",
))?,
file_name: input_path,
})
} else {
eprintln!(
Expand Down
2 changes: 1 addition & 1 deletion src/back/spv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl IdGenerator {
#[derive(Debug, Clone)]
pub struct DebugInfo<'a> {
pub source_code: &'a str,
pub file_name: &'a str,
pub file_name: &'a std::path::Path,
}

/// A SPIR-V block to which we are still adding instructions.
Expand Down
6 changes: 4 additions & 2 deletions src/back/spv/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1840,8 +1840,10 @@ impl Writer {
if self.flags.contains(WriterFlags::DEBUG) {
if let Some(debug_info) = debug_info.as_ref() {
let source_file_id = self.id_gen.next();
self.debugs
.push(Instruction::string(debug_info.file_name, source_file_id));
self.debugs.push(Instruction::string(
&debug_info.file_name.display().to_string(),
source_file_id,
));

debug_info_inner = Some(DebugInfoInner {
source_code: debug_info.source_code,
Expand Down
73 changes: 0 additions & 73 deletions tests/out/glsl/access.atomics.Compute.glsl

This file was deleted.

62 changes: 0 additions & 62 deletions tests/out/glsl/fragment-output.main.Fragment.glsl

This file was deleted.

11 changes: 0 additions & 11 deletions tests/out/glsl/invariant.frag_main.Fragment.glsl

This file was deleted.

26 changes: 0 additions & 26 deletions tests/out/glsl/quad.main.Fragment.glsl

This file was deleted.

23 changes: 0 additions & 23 deletions tests/out/glsl/quad.main.Vertex.glsl

This file was deleted.

3 changes: 0 additions & 3 deletions tests/out/hlsl/bits.hlsl.config

This file was deleted.

3 changes: 0 additions & 3 deletions tests/out/hlsl/constructors.hlsl.config

This file was deleted.

2 changes: 1 addition & 1 deletion tests/out/spv/debug-symbol-simple.spvasm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %24 "vs_main" %15 %18 %20 %22
OpEntryPoint Fragment %57 "fs_main" %51 %54 %56
OpExecutionMode %57 OriginUpperLeft
%3 = OpString "debug-symbol-simple"
%3 = OpString "debug-symbol-simple.wgsl"
OpSource Unknown 0 %3 "struct VertexInput {
@location(0) position: vec3<f32>,
@location(1) color: vec3<f32>,
Expand Down
2 changes: 1 addition & 1 deletion tests/out/spv/debug-symbol-terrain.spvasm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OpEntryPoint Fragment %587 "fs_main" %580 %582 %584 %586
OpExecutionMode %348 LocalSize 64 1 1
OpExecutionMode %470 OriginUpperLeft
OpExecutionMode %587 OriginUpperLeft
%3 = OpString "debug-symbol-terrain"
%3 = OpString "debug-symbol-terrain.wgsl"
OpSource Unknown 0 %3 "// Taken from https://github.com/sotrh/learn-wgpu/blob/11820796f5e1dbce42fb1119f04ddeb4b167d2a0/code/intermediate/tutorial13-terrain/src/terrain.wgsl
// ============================
// Terrain Generation
Expand Down
55 changes: 0 additions & 55 deletions tests/out/spv/pointer-access.spvasm

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading