Skip to content

Commit

Permalink
Fixed high version SPIR-V output format (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
PENGUINLIONG authored Mar 6, 2024
1 parent 4fd4a8c commit c598eab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
3 changes: 2 additions & 1 deletion scripts/Update-ExampleLogs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ foreach ($example in Get-ChildItem -Path "spirq/examples") {
}

foreach ($shader in Get-ChildItem -Path "assets") {
if ($shader.Name -notlike "*.json") {
# ignore json and direcotries.
if ($shader.Name -notlike "*.json" -and $shader.Name -notlike "*.spvasm" -and $shader.PSIsContainer -eq $false) {
& cargo run -p shader-reflect "$shader" --reference-all-resources > "assets/$($shader.Name).json"
}
}
30 changes: 3 additions & 27 deletions spirq-core/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,7 @@ impl fmt::Display for ImageType {
Some(false) => "Color",
None => "Depth?",
};
let dim = match self.dim {
Dim::Dim1D => "1D",
Dim::Dim2D => "2D",
Dim::Dim3D => "3D",
Dim::DimBuffer => "Buffer",
Dim::DimCube => "Cube",
Dim::DimRect => "Rect",
Dim::DimSubpassData => "SubpassData",
};
let dim = format!("{:?}", self.dim)[3..].to_owned();
let is_array = match self.is_array {
true => "Array",
false => "",
Expand Down Expand Up @@ -295,15 +287,7 @@ impl SpirvType for SampledImageType {
impl fmt::Display for SampledImageType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let scalar_ty = &self.scalar_ty;
let dim = match self.dim {
Dim::Dim1D => "1D",
Dim::Dim2D => "2D",
Dim::Dim3D => "3D",
Dim::DimBuffer => "Buffer",
Dim::DimCube => "Cube",
Dim::DimRect => "Rect",
Dim::DimSubpassData => "SubpassData",
};
let dim = format!("{:?}", self.dim)[3..].to_owned();
let depth = match self.is_depth {
Some(true) => "Depth",
Some(false) => "Color",
Expand Down Expand Up @@ -346,15 +330,7 @@ impl SpirvType for StorageImageType {
}
impl fmt::Display for StorageImageType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let dim = match self.dim {
Dim::Dim1D => "1D",
Dim::Dim2D => "2D",
Dim::Dim3D => "3D",
Dim::DimBuffer => "Buffer",
Dim::DimCube => "Cube",
Dim::DimRect => "Rect",
Dim::DimSubpassData => "SubpassData",
};
let dim = format!("{:?}", self.dim)[3..].to_owned();
let is_array = match self.is_array {
true => "Array",
false => "",
Expand Down

0 comments on commit c598eab

Please sign in to comment.