diff --git a/.references/spirv-tools b/.references/spirv-tools index 6d76521..bbd0e3f 100644 --- a/.references/spirv-tools +++ b/.references/spirv-tools @@ -1 +1 @@ -ede19b6 +a66a95e diff --git a/spirv-tools/source/val/validate_dot_product.cpp b/spirv-tools/source/val/validate_dot_product.cpp index 21cc4be..972c644 100644 --- a/spirv-tools/source/val/validate_dot_product.cpp +++ b/spirv-tools/source/val/validate_dot_product.cpp @@ -59,6 +59,12 @@ spv_result_t ValidateSameSignedDot(ValidationState_t& _, return _.diag(SPV_ERROR_INVALID_DATA, inst) << "'Vector 1' and 'Vector 2' must be the same type."; } else if (is_vec_1_scalar && is_vec_2_scalar) { + if (!_.HasCapability(spv::Capability::DotProductInput4x8BitPacked)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "DotProductInput4x8BitPacked capability is required to use " + "scalar integers."; + } + // If both are scalar, spec doesn't say Signedness needs to match const uint32_t vec_1_width = _.GetBitWidth(vec_1_id); const uint32_t vec_2_width = _.GetBitWidth(vec_2_id); @@ -139,6 +145,32 @@ spv_result_t ValidateSameSignedDot(ValidationState_t& _, << vec_1_width << ")."; } + if (!_.HasCapability(spv::Capability::DotProductInputAll)) { + // 4-wide 8-bit ints are special exception that has its own capability + if (vec_1_length == 4 && vec_1_width == 8) { + if (!_.HasCapability(spv::Capability::DotProductInput4x8Bit)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "DotProductInput4x8Bit or DotProductInputAll capability is " + "required to use 4-component vectors of 8-bit integers."; + } + } else { + // provide a more helpful message what is going on if we are here + // reporting this error + if (_.HasCapability(spv::Capability::DotProductInput4x8BitPacked)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "DotProductInputAll capability is required use vectors. " + "(DotProductInput4x8BitPacked capability declared allows " + "for only 32-bit int scalars)"; + } else { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "DotProductInputAll capability is additionally required to " + "the DotProduct capability to use vectors. (It is possible " + "to set DotProductInput4x8BitPacked to only use 32-bit " + "scalars packed as a 4-wide 8-byte vector)"; + } + } + } + if (opcode == spv::Op::OpUDot || opcode == spv::Op::OpUDotAccSat) { const bool vec_1_unsigned = _.IsIntScalarTypeWithSignedness(vec_1_type, 0); diff --git a/spirv-tools/spirv-tools/build-version.inc b/spirv-tools/spirv-tools/build-version.inc index f8ab93b..e6c6e66 100644 --- a/spirv-tools/spirv-tools/build-version.inc +++ b/spirv-tools/spirv-tools/build-version.inc @@ -1 +1 @@ -"v2026.2-dev", "SPIRV-Tools v2026.2-dev v2026.1-12-gede19b60" +"v2026.2-dev", "SPIRV-Tools v2026.2-dev v2026.1-13-ga66a95ee"