Skip to content

Commit

Permalink
Reverse filter for unsigned values and negative numbers
Browse files Browse the repository at this point in the history
In the previous PR for textureSample and textureSampleCompare
WGSL validation this check was backward.
  • Loading branch information
greggman committed Mar 14, 2024
1 parent 7453644 commit 58d25c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Validates that only incorrect coords arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-1, 0, 1] as const)
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.coordType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.coordType]) || t.value >= 0)
.expand('offset', ({ textureType }) => {
const offset = kValidTextureSampleParameterTypes[textureType].offsetArgType;
return offset ? [false, true] : [false];
Expand Down Expand Up @@ -113,7 +113,7 @@ Validates that only incorrect array_index arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-9, -8, 0, 7, 8])
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.arrayIndexType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.arrayIndexType]) || t.value >= 0)
)
.fn(t => {
const { textureType, arrayIndexType, value } = t.params;
Expand Down Expand Up @@ -153,7 +153,7 @@ Validates that only incorrect offset arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-9, -8, 0, 7, 8])
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.offsetType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.offsetType]) || t.value >= 0)
)
.fn(t => {
const { textureType, offsetType, value } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Validates that only incorrect coords arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-1, 0, 1] as const)
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.coordType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.coordType]) || t.value >= 0)
.expand('offset', ({ textureType }) => {
const offset = kValidTextureSampleCompareParameterTypes[textureType].offsetArgType;
return offset ? [false, true] : [false];
Expand Down Expand Up @@ -103,7 +103,7 @@ Validates that only incorrect array_index arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-9, -8, 0, 7, 8])
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.arrayIndexType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.arrayIndexType]) || t.value >= 0)
)
.fn(t => {
const { textureType, arrayIndexType, value } = t.params;
Expand Down Expand Up @@ -141,7 +141,7 @@ Validates that only incorrect depth_ref arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-1, 0, 1])
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.depthRefType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.depthRefType]) || t.value >= 0)
)
.fn(t => {
const { textureType, depthRefType, value } = t.params;
Expand Down Expand Up @@ -182,7 +182,7 @@ Validates that only incorrect offset arguments are rejected by ${builtin}
.beginSubcases()
.combine('value', [-9, -8, 0, 7, 8])
// filter out unsigned types with negative values
.filter(t => isUnsignedType(kValuesTypes[t.offsetType]) && t.value < 0)
.filter(t => !isUnsignedType(kValuesTypes[t.offsetType]) || t.value >= 0)
)
.fn(t => {
const { textureType, offsetType, value } = t.params;
Expand Down

0 comments on commit 58d25c6

Please sign in to comment.