[front/spir-v] Obey the is_depth field of OpTypeImage (#2341)

* [front/spir-v] Obey the is_depth field of OpTypeImage

* Add changed tests
This commit is contained in:
Ashley
2023-05-23 04:35:58 +12:00
committed by GitHub
parent 423a069dcd
commit ce48588d74
3 changed files with 11 additions and 23 deletions

View File

@@ -4708,7 +4708,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
let id = self.next()?;
let sample_type_id = self.next()?;
let dim = self.next()?;
let _is_depth = self.next()?;
let is_depth = self.next()?;
let is_array = self.next()? != 0;
let is_msaa = self.next()? != 0;
let _is_sampled = self.next()?;
@@ -4740,7 +4740,9 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
.ok_or(Error::InvalidImageBaseType(base_handle))?;
let inner = crate::TypeInner::Image {
class: if format != 0 {
class: if is_depth == 1 {
crate::ImageClass::Depth { multi: is_msaa }
} else if format != 0 {
crate::ImageClass::Storage {
format: map_image_format(format)?,
access: crate::StorageAccess::default(),

View File

@@ -90,9 +90,6 @@
(
bits: 64,
),
(
bits: 64,
),
],
functions: [
(
@@ -190,7 +187,7 @@
),
ref_count: 1,
assignable_global: Some(1),
ty: Handle(30),
ty: Handle(7),
),
(
uniformity: (
@@ -201,7 +198,7 @@
),
ref_count: 1,
assignable_global: Some(2),
ty: Handle(31),
ty: Handle(30),
),
(
uniformity: (
@@ -1256,7 +1253,7 @@
),
ref_count: 0,
assignable_global: Some(1),
ty: Handle(30),
ty: Handle(7),
),
(
uniformity: (
@@ -1267,7 +1264,7 @@
),
ref_count: 0,
assignable_global: Some(2),
ty: Handle(31),
ty: Handle(30),
),
(
uniformity: (

View File

@@ -50,8 +50,7 @@
inner: Image(
dim: D2,
arrayed: true,
class: Sampled(
kind: Float,
class: Depth(
multi: false,
),
),
@@ -269,16 +268,6 @@
space: Private,
),
),
(
name: None,
inner: Image(
dim: D2,
arrayed: true,
class: Depth(
multi: false,
),
),
),
(
name: None,
inner: Sampler(
@@ -616,7 +605,7 @@
group: 0,
binding: 2,
)),
ty: 30,
ty: 7,
init: None,
),
(
@@ -626,7 +615,7 @@
group: 0,
binding: 3,
)),
ty: 31,
ty: 30,
init: None,
),
(