case spv::OpSpecConstantTrue:
// These should have all been removed by preprocessing passes. If we see them here,
// our assumptions are wrong and we will probably generate wrong code.
- UNIMPLEMENTED("These instructions should have already been lowered.");
+ UNIMPLEMENTED("%s should have already been lowered.", OpcodeName(insn.opcode()).c_str());
break;
case spv::OpFConvert:
void SpirvShader::EmitDot(InsnIterator insn, SpirvRoutine *routine) const
{
auto &type = getType(insn.word(1));
- assert(type.sizeInComponents == 1);
+ ASSERT(type.sizeInComponents == 1);
auto &dst = routine->createIntermediate(insn.word(2), type.sizeInComponents);
auto &lhsType = getType(getObject(insn.word(3)).type);
auto lhs = GenericValue(this, routine, insn.word(3));
void SpirvShader::EmitAny(InsnIterator insn, SpirvRoutine *routine) const
{
auto &type = getType(insn.word(1));
- assert(type.sizeInComponents == 1);
+ ASSERT(type.sizeInComponents == 1);
auto &dst = routine->createIntermediate(insn.word(2), type.sizeInComponents);
auto &srcType = getType(getObject(insn.word(3)).type);
auto src = GenericValue(this, routine, insn.word(3));
void SpirvShader::EmitAll(InsnIterator insn, SpirvRoutine *routine) const
{
auto &type = getType(insn.word(1));
- assert(type.sizeInComponents == 1);
+ ASSERT(type.sizeInComponents == 1);
auto &dst = routine->createIntermediate(insn.word(2), type.sizeInComponents);
auto &srcType = getType(getObject(insn.word(3)).type);
auto src = GenericValue(this, routine, insn.word(3));
{
public:
Intermediate(uint32_t size) : scalar(new rr::Value*[size]), size(size) {
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
memset(scalar, 0, sizeof(rr::Value*) * size);
-#endif
}
~Intermediate()
Block const &getBlock(Block::ID id) const
{
auto it = blocks.find(id);
- ASSERT(it != blocks.end());
+ ASSERT_MSG(it != blocks.end(), "Unknown block %d", id.value());
return it->second;
}
Value& getValue(SpirvShader::Object::ID id)
{
auto it = lvalues.find(id);
- ASSERT(it != lvalues.end());
+ ASSERT_MSG(it != lvalues.end(), "Unknown value %d", id.value());
return it->second;
}
Intermediate const& getIntermediate(SpirvShader::Object::ID id) const
{
auto it = intermediates.find(id);
- ASSERT(it != intermediates.end());
+ ASSERT_MSG(it != intermediates.end(), "Unknown intermediate %d", id.value());
return it->second;
}
Pointer<Byte>& getPhysicalPointer(SpirvShader::Object::ID id)
{
auto it = physicalPointers.find(id);
- assert(it != physicalPointers.end());
+ ASSERT_MSG(it != physicalPointers.end(), "Unknown physical pointer %d", id.value());
return it->second;
}
};