mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-21 22:34:43 +00:00
Allow spec constant convert ops. (#2399)
This commit is contained in:
parent
87781d389e
commit
f2c68d71c8
@ -341,8 +341,14 @@ fn evaluate_spec_constant_op(
|
|||||||
|
|
||||||
let constant_to_instruction = |constant_id: Id| -> SmallVec<[Instruction; 1]> {
|
let constant_to_instruction = |constant_id: Id| -> SmallVec<[Instruction; 1]> {
|
||||||
let constant = &constants[&constant_id];
|
let constant = &constants[&constant_id];
|
||||||
debug_assert_eq!(constant.type_id, result_type_id);
|
if !matches!(
|
||||||
|
opcode,
|
||||||
|
SpecConstantInstruction::UConvert { .. }
|
||||||
|
| SpecConstantInstruction::SConvert { .. }
|
||||||
|
| SpecConstantInstruction::FConvert { .. }
|
||||||
|
) {
|
||||||
|
debug_assert_eq!(constant.type_id, result_type_id);
|
||||||
|
}
|
||||||
match constant.value {
|
match constant.value {
|
||||||
ConstantValue::Scalar(value) => smallvec![scalar_constant_to_instruction(
|
ConstantValue::Scalar(value) => smallvec![scalar_constant_to_instruction(
|
||||||
result_type_id,
|
result_type_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user