-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spirv-val: Make Constant evaluation consistent #5587
spirv-val: Make Constant evaluation consistent #5587
Conversation
if (!_.IsUnsignedIntScalarType(cluster_size_type)) { | ||
return _.diag(SPV_ERROR_INVALID_DATA, inst) | ||
<< "ClusterSize must be a scalar of integer type, whose " | ||
"Signedness operand is 0."; | ||
} | ||
|
||
uint64_t cluster_size; | ||
if (!_.GetConstantValUint64(cluster_size_op_id, &cluster_size)) { | ||
if (!spvOpcodeIsConstant(cluster_size_inst->opcode())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is an example were we using what I thought was a "get the constant value" but really here we want to check if it is any Op*Constant
and not the value itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try rebasing this branch. It feels like the smoketest failures are because this hasn't integrated the latest header changes.
@@ -1374,22 +1374,18 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, | |||
case spv::Op::OpTypeStruct: { | |||
// In case of structures, there is an additional constraint on the | |||
// index: the index must be an OpConstant. | |||
if (spv::Op::OpConstant != cur_word_instr->opcode()) { | |||
int64_t cur_index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is causing a build failure for android due to shortening later on.
c57100c
to
5ba07d2
Compare
prequel for #5577
We currently have multiple ways to get the constant values, and one to create a single system. This also keeps things consistent to not grab the constant value from a
OpSpecConstant*
should not be used