Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky committed Mar 2, 2021
1 parent 093272f commit 245d955
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion crates/rustc_codegen_spirv/src/codegen_cx/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ impl<'tcx> CodegenCx<'tcx> {
for attr in parse_attrs(self, self.tcx.get_attrs(instance.def_id())) {
match attr {
SpirvAttribute::Entry(entry) => {
let entry_name = entry.name.as_ref().map(ToString::to_string).unwrap_or_else(|| instance.to_string());
let entry_name = entry
.name
.as_ref()
.map(ToString::to_string)
.unwrap_or_else(|| instance.to_string());
self.entry_stub(&instance, &fn_abi, declared, entry_name, entry)
}
SpirvAttribute::UnrollLoops => {
Expand Down
8 changes: 5 additions & 3 deletions crates/spirv-builder/src/test/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ pub fn main() {

#[test]
fn custom_entry_point() {
dis_globals(r#"
dis_globals(
r#"
#[allow(unused_attributes)]
#[spirv(fragment(entry_point_name="hello_world"))]
pub fn main() { }
"#,
r#"OpCapability Shader
r#"OpCapability Shader
OpCapability VulkanMemoryModel
OpCapability VariablePointers
OpExtension "SPV_KHR_vulkan_memory_model"
Expand All @@ -45,7 +46,8 @@ OpEntryPoint Fragment %1 "hello_world"
OpExecutionMode %1 OriginUpperLeft
OpName %2 "test_project::main"
%3 = OpTypeVoid
%4 = OpTypeFunction %3"#);
%4 = OpTypeFunction %3"#,
);
}

#[test]
Expand Down

0 comments on commit 245d955

Please sign in to comment.