intel: use driReadDrawable in do_copy_texsubimage()
[mesa.git] / src / mesa / state_tracker / st_mesa_to_tgsi.c
index 3140ebe04adb09cd91baf05dd38d2e9e35dc87dd..2ab12d3cf3f0604368d91999b05f56f2cbb77434 100644 (file)
@@ -112,20 +112,6 @@ map_register_file_index(
 {
    switch( file ) {
    case TGSI_FILE_INPUT:
-      if (procType == TGSI_PROCESSOR_FRAGMENT &&
-          index == FRAG_ATTRIB_FOGC) {
-         if (GET_SWZ(*swizzle, 0) == SWIZZLE_X) {
-            /* do nothing we're, ok */
-         } else if (GET_SWZ(*swizzle, 0) == SWIZZLE_Y) {
-            /* replace the swizzle with xxxx */
-            *swizzle = MAKE_SWIZZLE4(SWIZZLE_X,
-                                     SWIZZLE_X,
-                                     SWIZZLE_X,
-                                     SWIZZLE_X);
-         } else {
-            /* fixme: point coord */
-         }
-      }
       /* inputs are mapped according to the user-defined map */
       return inputMapping[index];
 
@@ -151,12 +137,6 @@ map_texture_target(
     GLuint textarget,
     GLboolean shadow )
 {
-#if 1
-   /* XXX remove this line after we've checked that the rest of gallium
-    * can handle the TGSI_TEXTURE_SHADOWx tokens.
-    */
-   shadow = GL_FALSE;
-#endif
    switch( textarget ) {
    case TEXTURE_1D_INDEX:
       if (shadow)
@@ -218,11 +198,15 @@ static struct tgsi_full_immediate
 make_immediate(const float *value, uint size)
 {
    struct tgsi_full_immediate imm;
+   unsigned i;
 
    imm = tgsi_default_full_immediate();
    imm.Immediate.NrTokens += size;
    imm.Immediate.DataType = TGSI_IMM_FLOAT32;
-   imm.u.Pointer = value;
+
+   for (i = 0; i < size; i++)
+      imm.u[i].Float = value[i];
+
    return imm;
 }
 
@@ -261,6 +245,11 @@ compile_instruction(
       NULL,
       GL_FALSE );
    fulldst->DstRegister.WriteMask = convert_writemask( inst->DstReg.WriteMask );
+   if (inst->DstReg.RelAddr) {
+      fulldst->DstRegister.Indirect = 1;
+      fulldst->DstRegisterInd.File = TGSI_FILE_ADDRESS;
+      fulldst->DstRegisterInd.Index = 0;
+   }
 
    for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) {
       GLuint j;
@@ -358,7 +347,7 @@ compile_instruction(
       fullinst->Instruction.Opcode = TGSI_OPCODE_ADD;
       break;
    case OPCODE_BGNLOOP:
-      fullinst->Instruction.Opcode = TGSI_OPCODE_BGNLOOP2;
+      fullinst->Instruction.Opcode = TGSI_OPCODE_BGNLOOP;
       fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size;
       break;
    case OPCODE_BGNSUB:
@@ -416,7 +405,7 @@ compile_instruction(
       fullinst->Instruction.Opcode = TGSI_OPCODE_ENDIF;
       break;
    case OPCODE_ENDLOOP:
-      fullinst->Instruction.Opcode = TGSI_OPCODE_ENDLOOP2;
+      fullinst->Instruction.Opcode = TGSI_OPCODE_ENDLOOP;
       fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size;
       break;
    case OPCODE_ENDSUB: