i965/fs: Assert that nir_op_extract_*'s src1 is a constant.
authorMatt Turner <mattst88@gmail.com>
Mon, 16 May 2016 22:22:59 +0000 (15:22 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 18 May 2016 18:09:37 +0000 (11:09 -0700)
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index ad20dc8d92e61062413d1220743dbc91e517a60f..ebcc92a6753fce6b92217ca572580da41e979ee1 100644 (file)
@@ -1384,6 +1384,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
    case nir_op_extract_u8:
    case nir_op_extract_i8: {
       nir_const_value *byte = nir_src_as_const_value(instr->src[1].src);
+      assert(byte != NULL);
       bld.emit(SHADER_OPCODE_EXTRACT_BYTE,
                result, op[0], brw_imm_ud(byte->u32[0]));
       break;
@@ -1392,6 +1393,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
    case nir_op_extract_u16:
    case nir_op_extract_i16: {
       nir_const_value *word = nir_src_as_const_value(instr->src[1].src);
+      assert(word != NULL);
       bld.emit(SHADER_OPCODE_EXTRACT_WORD,
                result, op[0], brw_imm_ud(word->u32[0]));
       break;