llvmpipe: More verbose error message when failed to translate opcodes.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 16 Aug 2009 20:01:12 +0000 (21:01 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:33 +0000 (09:21 +0100)
src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c

index 60b9819fffeaf3a13d3c2f733b1b8001b0d57b2c..85c264947b4e1874047fa9689cb2ce1cb5b7dbcd 100644 (file)
@@ -1472,10 +1472,10 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
 
       case TGSI_TOKEN_TYPE_INSTRUCTION:
          if (!emit_instruction( &bld, &parse.FullToken.FullInstruction )) {
-           debug_printf("failed to translate tgsi opcode %d to SSE (%s)\n", 
-                        parse.FullToken.FullInstruction.Instruction.Opcode,
-                         parse.FullHeader.Processor.Processor == TGSI_PROCESSOR_VERTEX ?
-                         "vertex shader" : "fragment shader");
+            unsigned opcode = parse.FullToken.FullInstruction.Instruction.Opcode;
+            const struct tgsi_opcode_info *info = tgsi_get_opcode_info(opcode);
+           _debug_printf("warning: failed to translate tgsi opcode %s to LLVM\n",
+                         info ? info->mnemonic : "<invalid>");
         }
          break;