r600g/llvm: get use_kill from compiler shader
authorVincent Lejeune <vljn@ovi.com>
Sat, 27 Apr 2013 22:01:00 +0000 (00:01 +0200)
committerVincent Lejeune <vljn@ovi.com>
Tue, 30 Apr 2013 00:17:18 +0000 (02:17 +0200)
src/gallium/drivers/r600/r600_llvm.c
src/gallium/drivers/r600/r600_llvm.h
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/radeon/LLVM_REVISION.txt

index 2050be26df8af3a052d0fc54082a9da55e5cbc9c..83d73405f83127fdbba6f80cffe389a42b4ac3c3 100644 (file)
@@ -556,6 +556,7 @@ unsigned r600_llvm_compile(
        unsigned * inst_byte_count,
        enum radeon_family family,
        struct r600_bytecode *bc,
+       boolean *use_kill,
        unsigned dump)
 {
        unsigned r;
@@ -566,6 +567,7 @@ unsigned r600_llvm_compile(
        *inst_byte_count = binary.code_size;
        bc->ngpr = util_le32_to_cpu(*(uint32_t*)binary.config);
        bc->nstack = util_le32_to_cpu(*(uint32_t*)(binary.config + 4));
+       *use_kill = util_le32_to_cpu(*(uint32_t*)(binary.config + 8));
        return r;
 }
 
index 919dd244cd0241cd76cd1f38520fcd641468c5d8..50bbca63e37bc5aab9d57f236ed000e5f4792662 100644 (file)
@@ -22,6 +22,7 @@ unsigned r600_llvm_compile(
        unsigned * inst_byte_count,
        enum radeon_family family,
        struct r600_bytecode *bc,
+       boolean *use_kill,
        unsigned dump);
 
 #endif /* defined R600_USE_LLVM || defined HAVE_OPENCL */
index 0204f805432b43b832b31658ce5b1a21d758c203..81c4c36a8c88daa1b7c7921fe092f3b64f8b297f 100644 (file)
@@ -271,6 +271,7 @@ int r600_compute_shader_create(struct pipe_context * ctx,
        unsigned char * bytes;
        unsigned byte_count;
        struct r600_shader_ctx shader_ctx;
+       boolean use_kill = false;
        bool dump = (r600_ctx->screen->debug_flags & DBG_CS) != 0;
 
        shader_ctx.bc = bytecode;
@@ -1445,6 +1446,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
                struct radeon_llvm_context radeon_llvm_ctx;
                LLVMModuleRef mod;
                bool dump = r600_can_dump_shader(rscreen, ctx.type);
+               boolean use_kill = false;
 
                memset(&radeon_llvm_ctx, 0, sizeof(radeon_llvm_ctx));
                radeon_llvm_ctx.type = ctx.type;
@@ -1461,7 +1463,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
                mod = r600_tgsi_llvm(&radeon_llvm_ctx, tokens);
 
                if (r600_llvm_compile(mod, &inst_bytes, &inst_byte_count,
-                                     rscreen->family, ctx.bc, dump)) {
+                                     rscreen->family, ctx.bc, &use_kill, dump)) {
                        FREE(inst_bytes);
                        radeon_llvm_dispose(&radeon_llvm_ctx);
                        use_llvm = 0;
@@ -1471,6 +1473,8 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
                        ctx.file_offset[TGSI_FILE_OUTPUT] =
                                        ctx.file_offset[TGSI_FILE_INPUT];
                }
+               if (use_kill)
+                       ctx.shader->uses_kill = use_kill;
                radeon_llvm_dispose(&radeon_llvm_ctx);
        }
 #endif
index f003aab3152c46b61ebb5542d0a30f053d23b005..fcd93870bf4b035767beacd75ef372d7ef93bc9c 100644 (file)
@@ -1 +1 @@
-@180124
+@180751