Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
PENGUINLIONG committed Feb 13, 2024
1 parent 7b0fc60 commit 251c0a6
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 11 deletions.
60 changes: 50 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spirq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ ordered-float = "3.4.0"
[dev-dependencies]
bytes = "1.2"
byteorder = "1.3"
inline-spirv = "0.1"
inline-spirv = { version = "0.2", path = "../../inline-spirv/inline-spirv" }
37 changes: 37 additions & 0 deletions spirq/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,3 +722,40 @@ fn test_resource_in_chained_call() {
// Ensure the unreferenced one is not in the map.
assert_eq!(desc_binds.get(&DescriptorBinding::new(1, 3)), None);
}

#[test]
fn test_issue_124() {
inline_spirv!(r#"
OpCapability Shader
OpExtension "SPV_GOOGLE_hlsl_functionality1"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vert "vert" %in_var_POSITION %gl_Position
OpDecorateString %in_var_POSITION UserSemantic "POSITION"
OpDecorate %gl_Position BuiltIn Position
OpDecorateString %gl_Position UserSemantic "SV_POSITION"
OpDecorate %in_var_POSITION Location 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%_ptr_Output_v4float = OpTypePointer Output %v4float
%void = OpTypeVoid
%10 = OpTypeFunction %void
%in_var_POSITION = OpVariable %_ptr_Input_v4float Input
%gl_Position = OpVariable %_ptr_Output_v4float Output
%vert = OpFunction %void None %10
%11 = OpLabel
%12 = OpLoad %v4float %in_var_POSITION
OpStore %gl_Position %12
OpReturn
OpFunctionEnd
"#, spvasm);
let entry = ReflectConfig::new()
.spv(SPV)
.ref_all_rscs(true)
.reflect()
.unwrap()
.pop()
.unwrap();


}

0 comments on commit 251c0a6

Please sign in to comment.