mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
gallivm/tgsi: handle untyped moves
both mov and ucmp can be used to move variables of any type. correctly note that about ucmp in the tgsi_info and make sure gallivm can handle that by correctly casting the untyped moves. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
d56f2d5267
commit
fe29f99293
2 changed files with 10 additions and 0 deletions
|
|
@ -1084,6 +1084,15 @@ emit_store_chan(
|
|||
break;
|
||||
}
|
||||
|
||||
/* If the destination is untyped then the source can be anything,
|
||||
* but LLVM won't like if the types don't match so lets cast
|
||||
* to the correct destination type as expected by LLVM. */
|
||||
if (dtype == TGSI_TYPE_UNTYPED &&
|
||||
!lp_check_vec_type(bld_store->type, LLVMTypeOf(value))) {
|
||||
value = LLVMBuildBitCast(builder, value, bld_store->vec_type,
|
||||
"src_casted");
|
||||
}
|
||||
|
||||
switch( inst->Instruction.Saturate ) {
|
||||
case TGSI_SAT_NONE:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -327,6 +327,7 @@ tgsi_opcode_infer_dst_type( uint opcode )
|
|||
{
|
||||
switch (opcode) {
|
||||
case TGSI_OPCODE_MOV:
|
||||
case TGSI_OPCODE_UCMP:
|
||||
return TGSI_TYPE_UNTYPED;
|
||||
case TGSI_OPCODE_F2U:
|
||||
case TGSI_OPCODE_AND:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue