Skip to content

Commit

Permalink
Rename signed get_constant_* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Oct 18, 2024
1 parent 69a66db commit 2b62d7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 6 additions & 5 deletions vulkano/src/pipeline/shader/validate_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use crate::{
},
shader::{
reflect::{
get_constant, get_constant_composite, get_constant_composite_composite,
get_constant_float_composite, get_constant_maybe_composite, size_of_type,
get_constant, get_constant_composite, get_constant_float_composite,
get_constant_signed_composite_composite, get_constant_signed_maybe_composite,
size_of_type,
},
spirv::{
Capability, Decoration, Dim, ExecutionMode, ExecutionModel, FunctionInfo, Id,
Expand Down Expand Up @@ -2468,7 +2469,7 @@ impl<'a> RuntimeValidator<'a> {
if let Some(components) = image_operands
.const_offset
.or(image_operands.offset)
.and_then(|offset| get_constant_maybe_composite(self.spirv, offset))
.and_then(|offset| get_constant_signed_maybe_composite(self.spirv, offset))
{
for offset in components {
if offset < properties.min_texel_gather_offset as i64 {
Expand Down Expand Up @@ -2497,7 +2498,7 @@ impl<'a> RuntimeValidator<'a> {
}
} else if let Some(elements) = image_operands
.const_offsets
.and_then(|id| get_constant_composite_composite(self.spirv, id))
.and_then(|id| get_constant_signed_composite_composite(self.spirv, id))
{
for components in elements {
for offset in components {
Expand Down Expand Up @@ -2534,7 +2535,7 @@ impl<'a> RuntimeValidator<'a> {
if let Some(image_operands) = instruction.image_operands() {
if let Some(components) = image_operands
.const_offset
.and_then(|offset| get_constant_maybe_composite(self.spirv, offset))
.and_then(|offset| get_constant_signed_maybe_composite(self.spirv, offset))
{
for offset in components {
if offset < properties.min_texel_offset as i64 {
Expand Down
7 changes: 5 additions & 2 deletions vulkano/src/shader/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,10 @@ fn integer_constant_to_i64(spirv: &Spirv, value: &[u32], result_type_id: Id) ->
}
}

pub(crate) fn get_constant_maybe_composite(spirv: &Spirv, id: Id) -> Option<SmallVec<[i64; 4]>> {
pub(crate) fn get_constant_signed_maybe_composite(
spirv: &Spirv,
id: Id,
) -> Option<SmallVec<[i64; 4]>> {
match spirv.id(id).instruction() {
Instruction::Constant {
value,
Expand Down Expand Up @@ -1270,7 +1273,7 @@ pub(crate) fn get_constant_maybe_composite(spirv: &Spirv, id: Id) -> Option<Smal
}
}

pub(crate) fn get_constant_composite_composite(
pub(crate) fn get_constant_signed_composite_composite(
spirv: &Spirv,
id: Id,
) -> Option<SmallVec<[SmallVec<[i64; 4]>; 4]>> {
Expand Down

0 comments on commit 2b62d7c

Please sign in to comment.