Update diag() calls in validate_derivatives. (#1765)

This CL updates diag() in validate_derivatives to provide the
instruction of interest.
This commit is contained in:
dan sinclair 2018-08-01 11:04:22 -04:00 committed by GitHub
parent 83b7f2b674
commit 441c0190eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,14 +40,14 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) {
case SpvOpDPdyCoarse:
case SpvOpFwidthCoarse: {
if (!_.IsFloatScalarOrVectorType(result_type)) {
return _.diag(SPV_ERROR_INVALID_DATA)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Result Type to be float scalar or vector type: "
<< spvOpcodeString(opcode);
}
const uint32_t p_type = _.GetOperandTypeId(inst, 2);
if (p_type != result_type) {
return _.diag(SPV_ERROR_INVALID_DATA)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected P type and Result Type to be the same: "
<< spvOpcodeString(opcode);
}