Skip to content

Commit

Permalink
spv-out: configure source language in debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Sep 12, 2024
1 parent ee35b0e commit 8e3816e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion naga/src/back/spv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod selection;
mod subgroup;
mod writer;

pub use spirv::Capability;
pub use spirv::{Capability, SourceLanguage};

use crate::arena::{Handle, HandleVec};
use crate::proc::{BoundsCheckPolicies, TypeResolution};
Expand Down Expand Up @@ -89,6 +89,7 @@ impl IdGenerator {
pub struct DebugInfo<'a> {
pub source_code: &'a str,
pub file_name: &'a std::path::Path,
pub language: SourceLanguage,
}

/// A SPIR-V block to which we are still adding instructions.
Expand Down
2 changes: 1 addition & 1 deletion naga/src/back/spv/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ impl Writer {
source_file_id,
});
self.debugs.append(&mut Instruction::source_auto_continued(
spirv::SourceLanguage::Unknown,
debug_info.language,
0,
&debug_info_inner,
));
Expand Down

0 comments on commit 8e3816e

Please sign in to comment.