r600g/compute: Fix segfault caused by new shader disassembler
authorTom Stellard <thomas.stellard@amd.com>
Mon, 4 Feb 2013 19:31:54 +0000 (19:31 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 5 Feb 2013 15:41:33 +0000 (15:41 +0000)
src/gallium/drivers/r600/r600_isa.h
src/gallium/drivers/r600/r600_shader.c

index 5028a951efcd4808dd61b9835c68f725a851c458..c6f115fc070012b5bebcfac064e9908ef195d47a 100644 (file)
@@ -650,7 +650,8 @@ static const struct cf_op_info cf_op_table[] = {
                {"ALU_EXT",                       {   -1,   -1, 0x0C, 0x0C },  CF_CLAUSE | CF_ALU | CF_ALU_EXT  },
                {"ALU_CONTINUE",                  { 0x0D, 0x0D, 0x0D,   -1 },  CF_CLAUSE | CF_ALU  },
                {"ALU_BREAK",                     { 0x0E, 0x0E, 0x0E,   -1 },  CF_CLAUSE | CF_ALU  },
-               {"ALU_ELSE_AFTER",                { 0x0F, 0x0F, 0x0F, 0x0F },  CF_CLAUSE | CF_ALU  }
+               {"ALU_ELSE_AFTER",                { 0x0F, 0x0F, 0x0F, 0x0F },  CF_CLAUSE | CF_ALU  },
+               {"CF_NATIVE",                     { 0x00, 0x00, 0x00, 0x00 },  0  }
 };
 
 
@@ -1112,7 +1113,7 @@ static const struct cf_op_info cf_op_table[] = {
 #define CF_OP_ALU_ELSE_AFTER               87
 
 /* CF_NATIVE means that r600_bytecode_cf contains pre-encoded native data */
-#define CF_NATIVE                                                      (-1)
+#define CF_NATIVE                          88
 
 enum r600_chip_class {
        ISA_CC_R600,
index 8d07b638555ee95e0973a0803c2a96be6012baff..59a7f92d2c071a8f11d3cb90b6d0e7518f646607 100644 (file)
@@ -271,6 +271,7 @@ int r600_compute_shader_create(struct pipe_context * ctx,
        r600_bytecode_init(shader_ctx.bc, r600_ctx->chip_class, r600_ctx->family,
                           r600_ctx->screen->msaa_texture_support);
        shader_ctx.bc->type = TGSI_PROCESSOR_COMPUTE;
+       shader_ctx.bc->isa = r600_ctx->isa;
        r600_bytecode_from_byte_stream(&shader_ctx, bytes, byte_count);
        if (shader_ctx.bc->chip_class == CAYMAN) {
                cm_bytecode_add_cf_end(shader_ctx.bc);