break;
default:
/* BLORP is not supported before Gen6. */
- assert(false);
- break;
+ unreachable("not reached");
}
/* Make sure we didn't wrap the batch unintentionally, and make sure we
case MESA_FORMAT_Z_UNORM16: depth_format = BRW_DEPTHFORMAT_D16_UNORM; break;
case MESA_FORMAT_Z_FLOAT32: depth_format = BRW_DEPTHFORMAT_D32_FLOAT; break;
case MESA_FORMAT_Z24_UNORM_X8_UINT: depth_format = BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; break;
- default: assert(0); break;
+ default: unreachable("not reached");
}
}
filter, mirror_x, mirror_y);
break;
default:
- assert(false);
+ unreachable("not reached");
}
return true;
break;
}
default:
- assert(!"Unrecognized sample count in "
- "brw_blorp_blit_program::compute_frag_coords()");
- break;
+ unreachable("Unrecognized sample count in "
+ "brw_blorp_blit_program::compute_frag_coords()");
}
s_is_zero = false;
} else {
/* We can't compensate for compressed layout since at this point in the
* program we haven't read from the MCS buffer.
*/
- assert(!"Bad layout in encode_msaa");
- break;
+ unreachable("Bad layout in encode_msaa");
case INTEL_MSAA_LAYOUT_UMS:
/* No translation necessary. */
break;
/* We can't compensate for compressed layout since at this point in the
* program we don't have access to the MCS buffer.
*/
- assert(!"Bad layout in encode_msaa");
- break;
+ unreachable("Bad layout in encode_msaa");
case INTEL_MSAA_LAYOUT_UMS:
/* No translation necessary. */
break;
}
break;
default:
- assert(!"Should not get here.");
- break;
+ unreachable("Should not get here.");
};
}
wm_prog_key.texture_data_type = BRW_REGISTER_TYPE_D;
break;
default:
- assert(!"Unrecognized blorp format");
- break;
+ unreachable("Unrecognized blorp format");
}
if (brw->gen > 6) {
y1 = ALIGN(y1 * 2, 4);
break;
default:
- assert(!"Unrecognized sample count in brw_blorp_blit_params ctor");
- break;
+ unreachable("Unrecognized sample count in brw_blorp_blit_params ctor");
}
wm_prog_key.use_kill = true;
}
brw_emit_point_clip( &c );
break;
default:
- assert(0);
- return;
+ unreachable("not reached");
}
brw_compact_instructions(&c.func, 0, 0, NULL);
break;
case CLIP_CULL:
- assert(0);
- break;
+ unreachable("not reached");
}
}
case GL_UNSIGNED_INT: return uint_types_direct[size];
case GL_UNSIGNED_SHORT: return ushort_types_direct[size];
case GL_UNSIGNED_BYTE: return ubyte_types_direct[size];
- default: assert(0); return 0;
+ default: unreachable("not reached");
}
} else if (glarray->Type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
return BRW_SURFACEFORMAT_R11G11B10_FLOAT;
: BRW_SURFACEFORMAT_R10G10B10A2_UNORM;
}
return BRW_SURFACEFORMAT_R10G10B10A2_UINT;
- default: assert(0); return 0;
+ default: unreachable("not reached");
}
}
else {
* INT32_MAX, which will be scaled down by 1/65536 by the VS.
*/
return int_types_scale[size];
- default: assert(0); return 0;
+ default: unreachable("not reached");
}
}
}
case GL_UNSIGNED_BYTE: return BRW_INDEX_BYTE;
case GL_UNSIGNED_SHORT: return BRW_INDEX_WORD;
case GL_UNSIGNED_INT: return BRW_INDEX_DWORD;
- default: assert(0); return 0;
+ default: unreachable("not reached");
}
}
brw_inst_set_qtr_control(brw, p->current, GEN6_COMPRESSION_1H);
break;
default:
- assert(!"not reached");
- brw_inst_set_qtr_control(brw, p->current, GEN6_COMPRESSION_1H);
- break;
+ unreachable("not reached");
}
} else {
brw_inst_set_qtr_control(brw, p->current, compression_control);
case BRW_REGISTER_TYPE_UD:
break;
default:
- assert(!"Bad type for brw_AVG");
+ unreachable("Bad type for brw_AVG");
}
return brw_alu2(p, BRW_OPCODE_AVG, dest, src0, src1);
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
return 0;
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
return 0;
default:
- assert(!"not reached");
- return inst->mlen;
+ unreachable("not reached");
}
}
case SHADER_OPCODE_COS:
break;
default:
- assert(!"not reached: bad math opcode");
- return NULL;
+ unreachable("not reached: bad math opcode");
}
/* Can't do hstride == 0 args to gen6 math, so expand it out. We
case SHADER_OPCODE_POW:
break;
default:
- assert(!"not reached: unsupported binary math opcode.");
- return NULL;
+ unreachable("not reached: unsupported binary math opcode.");
}
if (brw->gen >= 8) {
case ir_binop_logic_or:
ir->fprint(stderr);
fprintf(stderr, "\n");
- assert(!"not reached: expression operates on scalars only");
- break;
+ unreachable("not reached: expression operates on scalars only");
case ir_binop_all_equal:
case ir_binop_any_nequal: {
ir_expression *last = NULL;
break;
}
case ir_unop_noise:
- assert(!"noise should have been broken down to function call");
- break;
+ unreachable("noise should have been broken down to function call");
case ir_binop_bfm: {
/* Does not need to be scalarized, since its result will be identical
}
case ir_binop_ubo_load:
- assert(!"not yet supported");
- break;
+ unreachable("not yet supported");
case ir_triop_fma:
case ir_triop_lrp:
case ir_triop_vector_insert:
case ir_quadop_bitfield_insert:
case ir_quadop_vector:
- assert(!"should have been lowered");
- break;
+ unreachable("should have been lowered");
case ir_unop_unpack_half_2x16_split_x:
case ir_unop_unpack_half_2x16_split_y:
case ir_binop_pack_half_2x16_split:
- assert(!"not reached: expression operates on scalars only");
- break;
+ unreachable("not reached: expression operates on scalars only");
}
ir->remove();
case OPCODE_DP3: count = 3; break;
case OPCODE_DP4: count = 4; break;
case OPCODE_DPH: count = 3; break;
- default: assert(!"not reached"); count = 0; break;
+ default: unreachable("not reached");
}
emit(MUL(acc, offset(src[0], 0), offset(src[1], 0)));
lod = offset(src[0], 3);
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
ir->type = glsl_type::vec4_type;
}
default:
- assert(!"not reached");
- coordinate_type = glsl_type::vec2_type;
- break;
+ unreachable("not reached");
}
ir_constant_data junk_data;
}
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
} else {
switch (inst->opcode) {
simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD16;
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
}
assert(msg_type != -1);
case IMM:
return BRW_IMMEDIATE_VALUE;
default:
- assert(!"not reached");
- return BRW_GENERAL_REGISTER_FILE;
+ unreachable("not reached");
}
}
brw_reg = brw_imm_ud(reg->imm.u);
break;
default:
- assert(!"not reached");
- brw_reg = brw_null_reg();
- break;
+ unreachable("not reached");
}
break;
case HW_REG:
brw_reg = brw_null_reg();
break;
case UNIFORM:
- assert(!"not reached");
- brw_reg = brw_null_reg();
- break;
+ unreachable("not reached");
default:
- assert(!"not reached");
- brw_reg = brw_null_reg();
- break;
+ unreachable("not reached");
}
if (reg->abs)
brw_reg = brw_abs(brw_reg);
abort();
case SHADER_OPCODE_LOAD_PAYLOAD:
- assert(!"Should be lowered by lower_load_payload()");
- break;
+ unreachable("Should be lowered by lower_load_payload()");
}
if (inst->no_dd_clear || inst->no_dd_check || inst->conditional_mod) {
break;
default:
ir->fprint(stderr);
- assert(!"not reached: non-channelwise dereference of LHS.");
+ unreachable("not reached: non-channelwise dereference of LHS.");
}
ir->lhs = new(mem_ctx) ir_dereference_variable(lhs->components[elem]);
break;
case ir_unop_exp:
case ir_unop_log:
- assert(!"not reached: should be handled by ir_explog_to_explog2");
- break;
+ unreachable("not reached: should be handled by ir_explog_to_explog2");
case ir_unop_sin:
case ir_unop_sin_reduced:
emit_math(SHADER_OPCODE_SIN, this->result, op[0]);
emit(ADD(this->result, op[0], op[1]));
break;
case ir_binop_sub:
- assert(!"not reached: should be handled by ir_sub_to_add_neg");
- break;
+ unreachable("not reached: should be handled by ir_sub_to_add_neg");
case ir_binop_mul:
if (brw->gen < 8 && ir->type->is_integer()) {
case ir_binop_dot:
case ir_unop_any:
- assert(!"not reached: should be handled by brw_fs_channel_expressions");
- break;
+ unreachable("not reached: should be handled by brw_fs_channel_expressions");
case ir_unop_noise:
- assert(!"not reached: should be handled by lower_noise");
- break;
+ unreachable("not reached: should be handled by lower_noise");
case ir_quadop_vector:
- assert(!"not reached: should be handled by lower_quadop_vector");
- break;
+ unreachable("not reached: should be handled by lower_quadop_vector");
case ir_binop_vector_extract:
- assert(!"not reached: should be handled by lower_vec_index_to_cond_assign()");
- break;
+ unreachable("not reached: should be handled by lower_vec_index_to_cond_assign()");
case ir_triop_vector_insert:
- assert(!"not reached: should be handled by lower_vector_insert()");
- break;
+ unreachable("not reached: should be handled by lower_vector_insert()");
case ir_binop_ldexp:
- assert(!"not reached: should be handled by ldexp_to_arith()");
- break;
+ unreachable("not reached: should be handled by ldexp_to_arith()");
case ir_unop_sqrt:
emit_math(SHADER_OPCODE_SQRT, this->result, op[0]);
case ir_unop_unpack_unorm_4x8:
case ir_unop_unpack_half_2x16:
case ir_unop_pack_half_2x16:
- assert(!"not reached: should be handled by lower_packing_builtins");
- break;
+ unreachable("not reached: should be handled by lower_packing_builtins");
case ir_unop_unpack_half_2x16_split_x:
emit(FS_OPCODE_UNPACK_HALF_2x16_SPLIT_X, this->result, op[0]);
break;
emit(BFI2(this->result, op[0], op[1], op[2]));
break;
case ir_quadop_bitfield_insert:
- assert(!"not reached: should be handled by "
+ unreachable("not reached: should be handled by "
"lower_instructions::bitfield_insert_to_bfm_bfi");
- break;
case ir_unop_bit_not:
emit(NOT(this->result, op[0]));
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
}
emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
mlen++;
} else {
- assert(!"Should not get here.");
+ unreachable("Should not get here.");
}
emit(MOV(fs_reg(MRF, base_mrf + mlen), shadow_c));
mcs = fs_reg(0u);
break;
default:
- assert(!"Unrecognized texture opcode");
+ unreachable("Unrecognized texture opcode");
};
/* Writemasking doesn't eliminate channels on SIMD8 texture
case SWIZZLE_Z: return 2;
case SWIZZLE_W: return 3;
default:
- assert(!"Not reached"); /* zero, one swizzles handled already */
- return 0;
+ unreachable("Not reached"); /* zero, one swizzles handled already */
}
}
emit(MOV(dst_reg, fs_reg((int)ir->value.b[i])));
break;
default:
- assert(!"Non-float/uint/int/bool constant");
+ unreachable("Non-float/uint/int/bool constant");
}
dst_reg.reg_offset++;
}
break;
default:
- assert(!"not reached");
- fail("bad cond code\n");
- break;
+ unreachable("not reached");
}
return;
}
brw_conditional_for_comparison(expr->operation)));
return;
default:
- assert(!"not reached");
- emit(IF(op[0], fs_reg(0), BRW_CONDITIONAL_NZ));
- fail("bad condition\n");
- return;
+ unreachable("not reached");
}
}
!strcmp("__intrinsic_atomic_predecrement", callee)) {
visit_atomic_counter_intrinsic(ir);
} else {
- assert(!"Unsupported intrinsic.");
+ unreachable("Unsupported intrinsic.");
}
}
void
fs_visitor::visit(ir_return *ir)
{
- assert(!"FINISHME");
+ unreachable("FINISHME");
}
void
}
void
-fs_visitor::visit(ir_function_signature *ir)
+fs_visitor::visit(ir_function_signature *)
{
- assert(!"not reached");
- (void)ir;
+ unreachable("not reached");
}
void
fs_visitor::visit(ir_emit_vertex *)
{
- assert(!"not reached");
+ unreachable("not reached");
}
void
fs_visitor::visit(ir_end_primitive *)
{
- assert(!"not reached");
+ unreachable("not reached");
}
void
case GL_NOTEQUAL:
return BRW_CONDITIONAL_NEQ;
default:
- assert(!"Not reached");
- return 0;
+ unreachable("Not reached");
}
}
check_edge_flag = true;
break;
default:
- assert(!"Unexpected primitive type in Gen6 SOL program.");
- return;
+ unreachable("Unexpected primitive type in Gen6 SOL program.");
}
gen6_sol_program(&c, key, num_verts, check_edge_flag);
} else {
dims = 3;
break;
default:
- assert(!"Should not get here: invalid sampler dimensionality");
- dims = 2;
+ unreachable("Should not get here: invalid sampler dimensionality");
}
if (type->sampler_array)
counter_format = 0b101;
break;
default:
- assert(!"Tried to enable OA counters on an unsupported generation.");
- return;
+ unreachable("Tried to enable OA counters on an unsupported generation.");
}
BEGIN_BATCH(3);
OUT_BATCH(report_id);
ADVANCE_BATCH();
} else {
- assert(!"Unsupported generation for performance counters.");
+ unreachable("Unsupported generation for performance counters.");
}
/* Reports apparently don't always get written unless we flush after. */
cut_index_will_work = ctx->Array.RestartIndex == 0xffffffff;
break;
default:
- cut_index_will_work = false;
- assert(0);
+ unreachable("not reached");
}
return cut_index_will_work;
}
default:
- assert(!"Unsupported target in brwNewProgram()");
- return NULL;
+ unreachable("Unsupported target in brwNewProgram()");
}
}
* this function should only ever be called with a target of
* GL_VERTEX_PROGRAM_ARB or GL_FRAGMENT_PROGRAM_ARB.
*/
- assert(!"Unexpected target in brwProgramStringNotify");
- break;
+ unreachable("Unexpected target in brwProgramStringNotify");
}
brw_add_texrect_params(prog);
break;
default:
- assert(!"Unrecognized query target in brw_queryobj_get_results()");
- break;
+ unreachable("Unrecognized query target in brw_queryobj_get_results()");
}
drm_intel_bo_unmap(query->bo);
break;
default:
- assert(!"Unrecognized query target in brw_begin_query()");
- break;
+ unreachable("Unrecognized query target in brw_begin_query()");
}
}
break;
default:
- assert(!"Unrecognized query target in brw_end_query()");
- break;
+ unreachable("Unrecognized query target in brw_end_query()");
}
}
return false;
default:
- assert(!"Unreachable.");
- return false;
+ unreachable("not reached");
}
}
brw_emit_anyprim_setup( &c );
break;
default:
- assert(0);
- return;
+ unreachable("not reached");
}
brw_compact_instructions(&c.func, 0, 0, NULL);
sf->sf6.cull_mode = BRW_CULLMODE_NONE;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
/* _NEW_LINE */
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
return BRW_REGISTER_TYPE_F;
case ir_binop_any_nequal: /* same as nequal for scalars */
return BRW_CONDITIONAL_NZ;
default:
- assert(!"not reached: bad operation for comparison");
- return BRW_CONDITIONAL_NZ;
+ unreachable("not reached: bad operation for comparison");
}
}
case SHADER_OPCODE_INT_REMAINDER:
return BRW_MATH_FUNCTION_INT_DIV_REMAINDER;
default:
- assert(!"not reached: unknown math function");
- return 0;
+ unreachable("not reached: unknown math function");
}
}
case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
return BRW_DEPTHFORMAT_D32_FLOAT_S8X24_UINT;
default:
- assert(!"Unexpected depth format.");
- return BRW_DEPTHFORMAT_D32_FLOAT;
+ unreachable("Unexpected depth format.");
}
}
case GL_FUNC_REVERSE_SUBTRACT:
return BRW_BLENDFUNCTION_REVERSE_SUBTRACT;
default:
- assert(0);
- return BRW_BLENDFUNCTION_ADD;
+ unreachable("not reached");
}
}
return BRW_BLENDFACTOR_INV_SRC1_ALPHA;
default:
- assert(0);
- return BRW_BLENDFACTOR_ZERO;
+ unreachable("not reached");
}
}
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
return 0;
default:
- assert(!"not reached");
- return inst->mlen;
+ unreachable("not reached");
}
}
inst->src[0] = src_reg(0u);
break;
default:
- assert(!"not reached");
- inst->src[0] = src_reg(0.0f);
- break;
+ unreachable("not reached");
}
inst->src[1] = src_reg();
progress = true;
break;
default:
- assert(!"not reached");
- brw_reg = brw_null_reg();
- break;
+ unreachable("not reached");
}
return brw_reg;
}
brw_reg = brw_imm_ud(src[i].imm.u);
break;
default:
- assert(!"not reached");
- brw_reg = brw_null_reg();
- break;
+ unreachable("not reached");
}
break;
break;
case ATTR:
default:
- assert(!"not reached");
- brw_reg = brw_null_reg();
- break;
+ unreachable("not reached");
}
return brw_reg;
}
break;
default:
- assert(!"should not get here: invalid vec4 texture opcode");
- break;
+ unreachable("should not get here: invalid vec4 texture opcode");
}
} else {
switch (inst->opcode) {
assert(inst->mlen == 2);
break;
default:
- assert(!"should not get here: invalid vec4 texture opcode");
- break;
+ unreachable("should not get here: invalid vec4 texture opcode");
}
}
emit(GS_OPCODE_GET_INSTANCE_ID, *reg);
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
return reg;
vec4_gs_visitor::emit_program_code()
{
/* We don't support NV_geometry_program4. */
- assert(!"Unreached");
+ unreachable("Unreached");
}
case SHADER_OPCODE_COS:
break;
default:
- assert(!"not reached: bad math opcode");
- return;
+ unreachable("not reached: bad math opcode");
}
if (brw->gen >= 8) {
case SHADER_OPCODE_INT_REMAINDER:
break;
default:
- assert(!"not reached: unsupported binary math opcode");
- return;
+ unreachable("not reached: unsupported binary math opcode");
}
if (brw->gen >= 8) {
void
vec4_visitor::emit_pack_half_2x16(dst_reg dst, src_reg src0)
{
- if (brw->gen < 7)
- assert(!"ir_unop_pack_half_2x16 should be lowered");
+ if (brw->gen < 7) {
+ unreachable("ir_unop_pack_half_2x16 should be lowered");
+ }
assert(dst.type == BRW_REGISTER_TYPE_UD);
assert(src0.type == BRW_REGISTER_TYPE_F);
void
vec4_visitor::emit_unpack_half_2x16(dst_reg dst, src_reg src0)
{
- if (brw->gen < 7)
- assert(!"ir_unop_unpack_half_2x16 should be lowered");
+ if (brw->gen < 7) {
+ unreachable("ir_unop_unpack_half_2x16 should be lowered");
+ }
assert(dst.type == BRW_REGISTER_TYPE_F);
assert(src0.type == BRW_REGISTER_TYPE_UD);
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
- assert(0);
- break;
+ unreachable("not reached");
}
return 0;
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
return;
}
return;
default:
- assert(!"not reached");
- emit(IF(op[0], src_reg(0), BRW_CONDITIONAL_NZ));
- return;
+ unreachable("not reached");
}
return;
}
break;
default:
- assert(!"not reached");
+ unreachable("not reached");
}
reg->type = brw_type_for_base_type(ir->type);
void
-vec4_visitor::visit(ir_function_signature *ir)
+vec4_visitor::visit(ir_function_signature *)
{
- assert(0);
- (void)ir;
+ unreachable("not reached");
}
void
break;
case ir_unop_exp:
case ir_unop_log:
- assert(!"not reached: should be handled by ir_explog_to_explog2");
- break;
+ unreachable("not reached: should be handled by ir_explog_to_explog2");
case ir_unop_sin:
case ir_unop_sin_reduced:
emit_math(SHADER_OPCODE_SIN, result_dst, op[0]);
case ir_unop_dFdx:
case ir_unop_dFdy:
- assert(!"derivatives not valid in vertex shader");
- break;
+ unreachable("derivatives not valid in vertex shader");
case ir_unop_bitfield_reverse:
emit(BFREV(result_dst, op[0]));
break;
case ir_unop_noise:
- assert(!"not reached: should be handled by lower_noise");
- break;
+ unreachable("not reached: should be handled by lower_noise");
case ir_binop_add:
emit(ADD(result_dst, op[0], op[1]));
break;
case ir_binop_sub:
- assert(!"not reached: should be handled by ir_sub_to_add_neg");
- break;
+ unreachable("not reached: should be handled by ir_sub_to_add_neg");
case ir_binop_mul:
if (brw->gen < 8 && ir->type->is_integer()) {
}
case ir_binop_vector_extract:
- assert(!"should have been lowered by vec_index_to_cond_assign");
- break;
+ unreachable("should have been lowered by vec_index_to_cond_assign");
case ir_triop_fma:
op[0] = fix_3src_operand(op[0]);
break;
case ir_triop_vector_insert:
- assert(!"should have been lowered by lower_vector_insert");
- break;
+ unreachable("should have been lowered by lower_vector_insert");
case ir_quadop_bitfield_insert:
- assert(!"not reached: should be handled by "
+ unreachable("not reached: should be handled by "
"bitfield_insert_to_bfm_bfi\n");
- break;
case ir_quadop_vector:
- assert(!"not reached: should be handled by lower_quadop_vector");
- break;
+ unreachable("not reached: should be handled by lower_quadop_vector");
case ir_unop_pack_half_2x16:
emit_pack_half_2x16(result_dst, op[0]);
case ir_unop_unpack_snorm_4x8:
case ir_unop_unpack_unorm_2x16:
case ir_unop_unpack_unorm_4x8:
- assert(!"not reached: should be handled by lower_packing_builtins");
- break;
+ unreachable("not reached: should be handled by lower_packing_builtins");
case ir_unop_unpack_half_2x16_split_x:
case ir_unop_unpack_half_2x16_split_y:
case ir_binop_pack_half_2x16_split:
- assert(!"not reached: should not occur in vertex shader");
- break;
+ unreachable("not reached: should not occur in vertex shader");
case ir_binop_ldexp:
- assert(!"not reached: should be handled by ldexp_to_arith()");
- break;
+ unreachable("not reached: should be handled by ldexp_to_arith()");
}
}
emit(MOV(*dst, src_reg(ir->value.b[i])));
break;
default:
- assert(!"Non-float/uint/int/bool constant");
- break;
+ unreachable("Non-float/uint/int/bool constant");
}
remaining_writemask &= ~dst->writemask;
!strcmp("__intrinsic_atomic_predecrement", callee)) {
visit_atomic_counter_intrinsic(ir);
} else {
- assert(!"Unsupported intrinsic.");
+ unreachable("Unsupported intrinsic.");
}
}
inst = new(mem_ctx) vec4_instruction(this, SHADER_OPCODE_TXS);
break;
case ir_txb:
- assert(!"TXB is not valid for vertex shaders.");
- break;
+ unreachable("TXB is not valid for vertex shaders.");
case ir_lod:
- assert(!"LOD is not valid for vertex shaders.");
- break;
+ unreachable("LOD is not valid for vertex shaders.");
default:
- assert(!"Unrecognized tex op");
+ unreachable("Unrecognized tex op");
}
if (ir->offset != NULL && ir->op != ir_txf)
case SWIZZLE_Z: return 2;
case SWIZZLE_W: return 3;
default:
- assert(!"Not reached"); /* zero, one swizzles handled already */
- return 0;
+ unreachable("Not reached"); /* zero, one swizzles handled already */
}
}
void
vec4_visitor::visit(ir_return *)
{
- assert(!"not reached");
+ unreachable("not reached");
}
void
vec4_visitor::visit(ir_discard *)
{
- assert(!"not reached");
+ unreachable("not reached");
}
void
void
vec4_visitor::visit(ir_emit_vertex *)
{
- assert(!"not reached");
+ unreachable("not reached");
}
void
vec4_visitor::visit(ir_end_primitive *)
{
- assert(!"not reached");
+ unreachable("not reached");
}
void
return dst_null_f();
default:
- assert(!"vec4_vp: bad destination register file");
- return dst_reg(this, glsl_type::vec4_type);
+ unreachable("vec4_vp: bad destination register file");
}
result.writemask = dst.WriteMask;
reg->writemask = WRITEMASK_Y;
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
return reg;
vs->thread4.nr_urb_entries = brw->urb.nr_vs_entries >> 2;
break;
default:
- assert(0);
+ unreachable("not reached");
}
} else {
switch (brw->urb.nr_vs_entries) {
assert(brw->is_g4x);
break;
default:
- assert(0);
+ unreachable("not reached");
}
vs->thread4.nr_urb_entries = brw->urb.nr_vs_entries;
}
return BRW_SURFACE_CUBE;
default:
- assert(0);
- return 0;
+ unreachable("not reached");
}
}
surface_format = BRW_SURFACEFORMAT_R32G32B32A32_FLOAT;
break;
default:
- assert(!"Invalid vector size for transform feedback output");
- surface_format = BRW_SURFACEFORMAT_R32_FLOAT;
- break;
+ unreachable("Invalid vector size for transform feedback output");
}
surf[0] = BRW_SURFACE_BUFFER << BRW_SURFACE_TYPE_SHIFT |
case GEN6_HIZ_OP_NONE:
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0;
dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5;
dw1 |= GEN7_CLIP_CULLMODE_BOTH;
break;
default:
- assert(!"Should not get here: invalid CullFlag");
- break;
+ unreachable("Should not get here: invalid CullFlag");
}
} else {
dw1 |= GEN7_CLIP_CULLMODE_NONE;
bits = brw_multisample_positions_8x[index >> 2] >> (8 * (index & 3));
break;
default:
- assert(!"Not implemented");
- return;
+ unreachable("Not implemented");
}
/* Convert from U0.4 back to a floating point coordinate. */
sample_positions_7654 = brw_multisample_positions_8x[1];
break;
default:
- assert(!"Unrecognized num_samples in gen6_emit_3dstate_multisample");
- break;
+ unreachable("Unrecognized num_samples in gen6_emit_3dstate_multisample");
}
/* 3DSTATE_MULTISAMPLE is nonpipelined. */
break;
default:
- assert(!"Unrecognized query target in brw_queryobj_get_results()");
- break;
+ unreachable("Unrecognized query target in brw_queryobj_get_results()");
}
drm_intel_bo_unmap(query->bo);
break;
default:
- assert(!"Unrecognized query target in brw_begin_query()");
- break;
+ unreachable("Unrecognized query target in brw_begin_query()");
}
}
break;
default:
- assert(!"Unrecognized query target in brw_end_query()");
- break;
+ unreachable("Unrecognized query target in brw_end_query()");
}
}
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
switch (ctx->Polygon.BackMode) {
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
/* _NEW_SCISSOR */
dw3 |= GEN6_SF_CULL_BOTH;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
} else {
dw3 |= GEN6_SF_CULL_NONE;
case GEN6_HIZ_OP_NONE:
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
dw1 |= GEN7_WM_LINE_AA_WIDTH_1_0;
dw1 |= GEN7_WM_LINE_END_CAP_AA_WIDTH_0_5;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
switch (ctx->Polygon.BackMode) {
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
dw2 = 0;
dw2 |= GEN6_SF_CULL_BOTH;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
} else {
dw2 |= GEN6_SF_CULL_NONE;
vertices_per_prim = 3;
break;
default:
- assert(!"Invalid transform feedback primitive mode.");
+ unreachable("Invalid transform feedback primitive mode.");
}
/* Get the number of primitives generated. */
return HSW_SCS_ONE;
}
- assert(!"Should not get here: invalid swizzle mode");
- return HSW_SCS_ZERO;
+ unreachable("Should not get here: invalid swizzle mode");
}
uint32_t
dw1 |= GEN8_WM_HZ_DEPTH_CLEAR;
break;
case GEN6_HIZ_OP_NONE:
- assert(!"Should not get here.");
+ unreachable("Should not get here.");
}
if (mt->num_samples > 0)
}
break;
default:
- assert(!"not reached");
- break;
+ unreachable("not reached");
}
assert(msg_type != -1);
case FS_OPCODE_PIXEL_X:
case FS_OPCODE_PIXEL_Y:
- assert(!"FS_OPCODE_PIXEL_X and FS_OPCODE_PIXEL_Y are only for Gen4-5.");
- break;
+ unreachable("FS_OPCODE_PIXEL_X and FS_OPCODE_PIXEL_Y are only for Gen4-5.");
case FS_OPCODE_CINTERP:
MOV(dst, src[0]);
break;
case SHADER_OPCODE_SHADER_TIME_ADD:
- assert(!"XXX: Missing Gen8 scalar support for INTEL_DEBUG=shader_time");
- break;
+ unreachable("XXX: Missing Gen8 scalar support for INTEL_DEBUG=shader_time");
case SHADER_OPCODE_UNTYPED_ATOMIC:
generate_untyped_atomic(ir, dst, src[0], src[1]);
return ip;
}
}
- assert(!"not reached");
- return start;
+ unreachable("not reached");
}
/* After program generation, go back and update the UIP and JIP of
dw1 |= GEN8_RASTER_CULL_BOTH;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
} else {
dw1 |= GEN8_RASTER_CULL_NONE;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
switch (ctx->Polygon.BackMode) {
dw1 |= GEN6_SF_BACK_POINT;
break;
default:
- assert(0);
- break;
+ unreachable("not reached");
}
/* _NEW_LINE */
case 16:
return GEN8_SURFACE_VALIGN_16;
default:
- assert(!"Unsupported vertical surface alignment.");
- return GEN8_SURFACE_VALIGN_4;
+ unreachable("Unsupported vertical surface alignment.");
}
}
case 16:
return GEN8_SURFACE_HALIGN_16;
default:
- assert(!"Unsupported horizontal surface alignment.");
- return GEN8_SURFACE_HALIGN_4;
+ unreachable("Unsupported horizontal surface alignment.");
}
}
}
break;
default:
- assert(!"should not get here: invalid VS texture opcode");
- break;
+ unreachable("should not get here: invalid VS texture opcode");
}
if (ir->header_present) {
break;
case SHADER_OPCODE_SHADER_TIME_ADD:
- assert(!"XXX: Missing Gen8 vec4 support for INTEL_DEBUG=shader_time");
- break;
+ unreachable("XXX: Missing Gen8 vec4 support for INTEL_DEBUG=shader_time");
case SHADER_OPCODE_UNTYPED_ATOMIC:
generate_untyped_atomic(ir, dst, src[0], src[1]);
break;
case VS_OPCODE_UNPACK_FLAGS_SIMD4X2:
- assert(!"VS_OPCODE_UNPACK_FLAGS_SIMD4X2 should not be used on Gen8+.");
- break;
+ unreachable("VS_OPCODE_UNPACK_FLAGS_SIMD4X2 should not be used on Gen8+.");
default:
if (ir->opcode < (int) ARRAY_SIZE(opcode_descs)) {
return BR13_8;
break;
default:
- assert(0);
- return 0;
+ unreachable("not reached");
}
}
{
switch (mt->tiling) {
default:
- assert(!"Non-MSRT MCS requires X or Y tiling");
+ unreachable("Non-MSRT MCS requires X or Y tiling");
/* In release builds, fall through */
case I915_TILING_Y:
*width_px = 32 / mt->cpp;
/* num_samples should already have been quantized to 0, 1, 2, 4, or
* 8.
*/
- assert(false);
+ unreachable("not reached");
}
} else {
/* Non-interleaved */
switch (tiling) {
default:
- assert(false);
+ unreachable("not reached");
case I915_TILING_NONE:
*mask_x = *mask_y = 0;
break;
switch (tiling) {
default:
- assert(false);
+ unreachable("not reached");
case I915_TILING_NONE:
return y * pitch + x * cpp;
case I915_TILING_X:
format = MESA_FORMAT_R_UINT32;
break;
default:
- assert(!"Unrecognized sample count in intel_miptree_alloc_mcs");
- return false;
+ unreachable("Unrecognized sample count in intel_miptree_alloc_mcs");
};
/* From the Ivy Bridge PRM, Vol4 Part1 p76, "MCS Base Address":
psp->max_gl_es2_version = 20;
break;
default:
- assert(!"unrecognized intel_screen::gen");
- break;
+ unreachable("unrecognized intel_screen::gen");
}
}
return BRW_COMPAREFUNCTION_NEVER;
}
- assert(!"Invalid shadow comparison function.");
- return BRW_COMPAREFUNCTION_NEVER;
+ unreachable("Invalid shadow comparison function.");
}
int
return BRW_COMPAREFUNCTION_ALWAYS;
}
- assert(!"Invalid comparison function.");
- return BRW_COMPAREFUNCTION_ALWAYS;
+ unreachable("Invalid comparison function.");
}
int
span = ytile_span;
tile_copy = ytile_copy_faster;
} else {
- assert(!"unsupported tiling");
- return;
+ unreachable("unsupported tiling");
}
/* Round out to tile boundaries. */
protected:
virtual dst_reg *make_reg_for_system_value(ir_variable *ir)
{
- assert(!"Not reached");
- return NULL;
+ unreachable("Not reached");
}
virtual void setup_payload()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_prolog()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_program_code()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_thread_end()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_urb_write_header(int mrf)
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual vec4_instruction *emit_urb_write_opcode(bool complete)
protected:
virtual dst_reg *make_reg_for_system_value(ir_variable *ir)
{
- assert(!"Not reached");
- return NULL;
+ unreachable("Not reached");
}
virtual void setup_payload()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_prolog()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_program_code()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_thread_end()
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual void emit_urb_write_header(int mrf)
{
- assert(!"Not reached");
+ unreachable("Not reached");
}
virtual vec4_instruction *emit_urb_write_opcode(bool complete)