Check if source is empty when constructing hal::DebugSource (0.18 backport) (#4693)

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
This commit is contained in:
Daniel Jacobs 2023-11-15 14:33:36 -05:00 committed by Connor Fitzgerald
parent 957e2849dd
commit ca96cb428c
No known key found for this signature in database
GPG Key ID: CF0A1F83B4E1A995

View File

@ -1317,7 +1317,8 @@ impl<A: HalApi> Device<A> {
.contains(wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES),
);
let debug_source = if self.instance_flags.contains(wgt::InstanceFlags::DEBUG) {
let debug_source =
if self.instance_flags.contains(wgt::InstanceFlags::DEBUG) && !source.is_empty() {
Some(hal::DebugSource {
file_name: Cow::Owned(
desc.label