VirtualBox

vbox的更動 98914 路徑 trunk/src/VBox/Additions/3D


忽略:
時間撮記:
2023-3-11 下午11:08:00 (21 月 以前)
作者:
vboxsync
訊息:

Additions/3D/mesa: TGSI_OPCODE_ARR and fix for indirect addressing in the TGSI->VGPU10 shader translation code

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/3D/mesa/mesa-21.3.8/src/gallium/drivers/svga/svga_tgsi_vgpu10.c

    r96488 r98914  
    11561156static void
    11571157emit_indirect_register(struct svga_shader_emitter_v10 *emit,
     1158#ifndef VBOX_WITH_MESA3D_NINE_SVGA
    11581159                       unsigned addr_reg_index)
     1160#else
     1161                       unsigned addr_reg_index,
     1162                       unsigned addr_reg_select)
     1163#endif
    11591164{
    11601165   unsigned tmp_reg_index;
     
    11721177   operand0.index0Representation = VGPU10_OPERAND_INDEX_IMMEDIATE32;
    11731178   operand0.selectionMode = VGPU10_OPERAND_4_COMPONENT_SELECT_1_MODE;
     1179#ifndef VBOX_WITH_MESA3D_NINE_SVGA
    11741180   operand0.swizzleX = 0;
    11751181   operand0.swizzleY = 1;
    11761182   operand0.swizzleZ = 2;
    11771183   operand0.swizzleW = 3;
     1184#else
     1185   operand0.selectMask = addr_reg_select;
     1186#endif
    11781187
    11791188   emit_dword(emit, operand0.value);
     
    14361445
    14371446   if (indirect) {
     1447#ifndef VBOX_WITH_MESA3D_NINE_SVGA
    14381448      emit_indirect_register(emit, reg->Indirect.Index);
     1449#else
     1450      emit_indirect_register(emit, reg->Indirect.Index, reg->Indirect.Swizzle);
     1451#endif
    14391452   }
    14401453}
     
    18281841
    18291842         if (indirect2d) {
     1843#ifndef VBOX_WITH_MESA3D_NINE_SVGA
    18301844            emit_indirect_register(emit, reg->DimIndirect.Index);
     1845#else
     1846            emit_indirect_register(emit, reg->DimIndirect.Index, reg->DimIndirect.Swizzle);
     1847#endif
    18311848         }
    18321849      }
     
    18351852
    18361853      if (indirect) {
     1854#ifndef VBOX_WITH_MESA3D_NINE_SVGA
    18371855         emit_indirect_register(emit, reg->Indirect.Index);
     1856#else
     1857         emit_indirect_register(emit, reg->Indirect.Index, reg->Indirect.Swizzle);
     1858#endif
    18381859      }
    18391860   }
     
    64026423}
    64036424
     6425
     6426#ifdef VBOX_WITH_MESA3D_NINE_SVGA
     6427/**
     6428 * Emit code for TGSI_OPCODE_ARR instruction.
     6429 */
     6430static boolean
     6431emit_arr(struct svga_shader_emitter_v10 *emit,
     6432         const struct tgsi_full_instruction *inst)
     6433{
     6434   unsigned index = inst->Dst[0].Register.Index;
     6435   struct tgsi_full_src_register half = make_immediate_reg_float(emit, 0.5f);
     6436   struct tgsi_full_dst_register address_reg_dst;
     6437   struct tgsi_full_src_register address_reg_src;
     6438   VGPU10_OPCODE_TYPE opcode;
     6439
     6440   assert(index < MAX_VGPU10_ADDR_REGS);
     6441   address_reg_dst = make_dst_temp_reg(emit->address_reg_index[index]);
     6442   address_reg_dst = writemask_dst(&address_reg_dst, inst->Dst[0].Register.WriteMask);
     6443
     6444   address_reg_src = make_src_temp_reg(emit->address_reg_index[index]);
     6445
     6446   /* ARR dst, s0
     6447    * Translates into:
     6448    * ADD address_tmp, s0, 0.5f
     6449    * FTOI address_tmp, address_tmp
     6450    */
     6451
     6452   emit_instruction_op2(emit, VGPU10_OPCODE_ADD, &address_reg_dst, &inst->Src[0], &half);
     6453   emit_instruction_op1(emit, VGPU10_OPCODE_FTOI, &address_reg_dst, &address_reg_src);
     6454
     6455   return TRUE;
     6456}
     6457#endif
    64046458
    64056459/**
     
    93809434   case TGSI_OPCODE_UARL:
    93819435      return emit_arl_uarl(emit, inst);
     9436#ifdef VBOX_WITH_MESA3D_NINE_SVGA
     9437   case TGSI_OPCODE_ARR:
     9438      return emit_arr(emit, inst);
     9439#endif
    93829440   case TGSI_OPCODE_BGNSUB:
    93839441      /* no-op */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette