Add details for error messages in validate_pipeline_descriptor_sets (#2509)

* add details in error messages for RecordingCommandBuffer::validate_pipeline_descriptor_sets

* update messages

* fix case
This commit is contained in:
ComfyFluffy 2024-03-29 11:18:03 -07:00 committed by GitHub
parent e9c650c966
commit 78f3f9f508
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1827,14 +1827,15 @@ impl RecordingCommandBuffer {
*/
// The SPIR-V Image Format is not compatible with the image views format.
if let Some(format) = binding_reqs.image_format {
if image_view.format() != format {
if let Some(required_format) = binding_reqs.image_format {
let format = image_view.format();
if format != required_format {
return Err(Box::new(ValidationError {
problem: format!(
"the currently bound pipeline accesses the image view \
"the currently bound pipeline requires the image view \
bound to descriptor set {set_num}, binding {binding_num}, \
descriptor index {index}, but the format of the image view \
is not equal to the format required by the pipeline"
descriptor index {index} to have a format of `{required_format:?}`, \
but the actual format is `{format:?}`"
)
.into(),
// vuids?
@ -1844,14 +1845,16 @@ impl RecordingCommandBuffer {
}
// Rules for viewType
if let Some(image_view_type) = binding_reqs.image_view_type {
if image_view.view_type() != image_view_type {
if let Some(required_image_view_type) = binding_reqs.image_view_type {
let image_view_type = image_view.view_type();
if image_view_type != required_image_view_type {
return Err(Box::new(ValidationError {
problem: format!(
"the currently bound pipeline accesses the image view \
"the currently bound pipeline requires the image view \
bound to descriptor set {set_num}, binding {binding_num}, \
descriptor index {index}, but the view type of the image view \
is not equal to the view type required by the pipeline"
descriptor index {index} to have a view type of `{required_image_view_type:?}`, \
but the actual view type is `{image_view_type:?}`
"
)
.into(),
vuids: vuids!(vuid_type, "viewType-07752"),