Ejemplo n.º 1
0
struct tgsi_dst_register_ext_concode
tgsi_build_dst_register_ext_concode(
   unsigned cc,
   unsigned swizzle_x,
   unsigned swizzle_y,
   unsigned swizzle_z,
   unsigned swizzle_w,
   int index,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_dst_register_ext_concode dst_register_ext_concode;

   assert( cc <= TGSI_CC_FL );
   assert( swizzle_x <= TGSI_SWIZZLE_W );
   assert( swizzle_y <= TGSI_SWIZZLE_W );
   assert( swizzle_z <= TGSI_SWIZZLE_W );
   assert( swizzle_w <= TGSI_SWIZZLE_W );
   assert( index >= -32768 && index <= 32767 );

   dst_register_ext_concode = tgsi_default_dst_register_ext_concode();
   dst_register_ext_concode.CondMask = cc;
   dst_register_ext_concode.CondSwizzleX = swizzle_x;
   dst_register_ext_concode.CondSwizzleY = swizzle_y;
   dst_register_ext_concode.CondSwizzleZ = swizzle_z;
   dst_register_ext_concode.CondSwizzleW = swizzle_w;
   dst_register_ext_concode.CondSrcIndex = index;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return dst_register_ext_concode;
}
Ejemplo n.º 2
0
struct tgsi_src_register_ext_mod
tgsi_build_src_register_ext_mod(
   unsigned complement,
   unsigned bias,
   unsigned scale_2x,
   unsigned absolute,
   unsigned negate,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_src_register_ext_mod src_register_ext_mod;

   assert( complement <= 1 );
   assert( bias <= 1 );
   assert( scale_2x <= 1 );
   assert( absolute <= 1 );
   assert( negate <= 1 );

   src_register_ext_mod = tgsi_default_src_register_ext_mod();
   src_register_ext_mod.Complement = complement;
   src_register_ext_mod.Bias = bias;
   src_register_ext_mod.Scale2X = scale_2x;
   src_register_ext_mod.Absolute = absolute;
   src_register_ext_mod.Negate = negate;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return src_register_ext_mod;
}
Ejemplo n.º 3
0
struct tgsi_instruction_ext_nv
tgsi_build_instruction_ext_nv(
   unsigned precision,
   unsigned cond_dst_index,
   unsigned cond_flow_index,
   unsigned cond_mask,
   unsigned cond_swizzle_x,
   unsigned cond_swizzle_y,
   unsigned cond_swizzle_z,
   unsigned cond_swizzle_w,
   unsigned cond_dst_update,
   unsigned cond_flow_enable,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_ext_nv instruction_ext_nv;

   instruction_ext_nv = tgsi_default_instruction_ext_nv();
   instruction_ext_nv.Precision = precision;
   instruction_ext_nv.CondDstIndex = cond_dst_index;
   instruction_ext_nv.CondFlowIndex = cond_flow_index;
   instruction_ext_nv.CondMask = cond_mask;
   instruction_ext_nv.CondSwizzleX = cond_swizzle_x;
   instruction_ext_nv.CondSwizzleY = cond_swizzle_y;
   instruction_ext_nv.CondSwizzleZ = cond_swizzle_z;
   instruction_ext_nv.CondSwizzleW = cond_swizzle_w;
   instruction_ext_nv.CondDstUpdate = cond_dst_update;
   instruction_ext_nv.CondFlowEnable = cond_flow_enable;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return instruction_ext_nv;
}
Ejemplo n.º 4
0
static struct tgsi_dst_register
tgsi_build_dst_register(
   unsigned file,
   unsigned mask,
   unsigned indirect,
   unsigned dimension,
   int index,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_dst_register dst_register;

   assert( file < TGSI_FILE_COUNT );
   assert( mask <= TGSI_WRITEMASK_XYZW );
   assert( index >= -32768 && index <= 32767 );

   dst_register.File = file;
   dst_register.WriteMask = mask;
   dst_register.Indirect = indirect;
   dst_register.Dimension = dimension;
   dst_register.Index = index;
   dst_register.Padding = 0;

   instruction_grow( instruction, header );

   return dst_register;
}
Ejemplo n.º 5
0
static struct tgsi_instruction_label
tgsi_build_instruction_label(
   unsigned label,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_label instruction_label;

   instruction_label.Label = label;
   instruction_label.Padding = 0;
   instruction->Label = 1;

   instruction_grow( instruction, header );

   return instruction_label;
}
Ejemplo n.º 6
0
struct tgsi_instruction_ext_texture
tgsi_build_instruction_ext_texture(
   unsigned texture,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_ext_texture instruction_ext_texture;

   instruction_ext_texture = tgsi_default_instruction_ext_texture();
   instruction_ext_texture.Texture = texture;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return instruction_ext_texture;
}
Ejemplo n.º 7
0
struct tgsi_instruction_ext_label
tgsi_build_instruction_ext_label(
   unsigned label,
   struct tgsi_token  *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_ext_label instruction_ext_label;

   instruction_ext_label = tgsi_default_instruction_ext_label();
   instruction_ext_label.Label = label;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return instruction_ext_label;
}
Ejemplo n.º 8
0
static struct tgsi_instruction_memory
tgsi_build_instruction_memory(
   unsigned qualifier,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_memory instruction_memory;

   instruction_memory.Qualifier = qualifier;
   instruction_memory.Padding = 0;
   instruction->Memory = 1;

   instruction_grow( instruction, header );

   return instruction_memory;
}
Ejemplo n.º 9
0
struct tgsi_dimension
tgsi_build_dimension(
   unsigned indirect,
   unsigned index,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_dimension dimension;

   dimension = tgsi_default_dimension();
   dimension.Indirect = indirect;
   dimension.Index = index;

   instruction_grow( instruction, header );

   return dimension;
}
Ejemplo n.º 10
0
static struct tgsi_dimension
tgsi_build_dimension(
   unsigned indirect,
   unsigned index,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_dimension dimension;

   dimension.Indirect = indirect;
   dimension.Dimension = 0;
   dimension.Padding = 0;
   dimension.Index = index;

   instruction_grow( instruction, header );

   return dimension;
}
Ejemplo n.º 11
0
static struct tgsi_instruction_texture
tgsi_build_instruction_texture(
   unsigned texture,
   unsigned num_offsets,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_texture instruction_texture;

   instruction_texture.Texture = texture;
   instruction_texture.NumOffsets = num_offsets;
   instruction_texture.Padding = 0;
   instruction->Texture = 1;

   instruction_grow( instruction, header );

   return instruction_texture;
}
Ejemplo n.º 12
0
static struct tgsi_texture_offset
tgsi_build_texture_offset(
   int index, int file, int swizzle_x, int swizzle_y, int swizzle_z,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_texture_offset texture_offset;

   texture_offset.Index = index;
   texture_offset.File = file;
   texture_offset.SwizzleX = swizzle_x;
   texture_offset.SwizzleY = swizzle_y;
   texture_offset.SwizzleZ = swizzle_z;
   texture_offset.Padding = 0;

   instruction_grow( instruction, header );

   return texture_offset;
}
Ejemplo n.º 13
0
struct tgsi_dst_register_ext_modulate
tgsi_build_dst_register_ext_modulate(
   unsigned modulate,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_dst_register_ext_modulate dst_register_ext_modulate;

   assert( modulate <= TGSI_MODULATE_EIGHTH );

   dst_register_ext_modulate = tgsi_default_dst_register_ext_modulate();
   dst_register_ext_modulate.Modulate = modulate;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return dst_register_ext_modulate;
}
Ejemplo n.º 14
0
static struct tgsi_instruction_memory
tgsi_build_instruction_memory(
   unsigned qualifier,
   unsigned texture,
   unsigned format,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_instruction_memory instruction_memory;

   instruction_memory.Qualifier = qualifier;
   instruction_memory.Texture = texture;
   instruction_memory.Format = format;
   instruction_memory.Padding = 0;
   instruction->Memory = 1;

   instruction_grow( instruction, header );

   return instruction_memory;
}
Ejemplo n.º 15
0
static struct tgsi_src_register
tgsi_build_src_register(
   unsigned file,
   unsigned swizzle_x,
   unsigned swizzle_y,
   unsigned swizzle_z,
   unsigned swizzle_w,
   unsigned negate,
   unsigned absolute,
   unsigned indirect,
   unsigned dimension,
   int index,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_src_register   src_register;

   assert( file < TGSI_FILE_COUNT );
   assert( swizzle_x <= TGSI_SWIZZLE_W );
   assert( swizzle_y <= TGSI_SWIZZLE_W );
   assert( swizzle_z <= TGSI_SWIZZLE_W );
   assert( swizzle_w <= TGSI_SWIZZLE_W );
   assert( negate <= 1 );
   assert( index >= -0x8000 && index <= 0x7FFF );

   src_register.File = file;
   src_register.SwizzleX = swizzle_x;
   src_register.SwizzleY = swizzle_y;
   src_register.SwizzleZ = swizzle_z;
   src_register.SwizzleW = swizzle_w;
   src_register.Negate = negate;
   src_register.Absolute = absolute;
   src_register.Indirect = indirect;
   src_register.Dimension = dimension;
   src_register.Index = index;

   instruction_grow( instruction, header );

   return src_register;
}
Ejemplo n.º 16
0
struct tgsi_src_register_ext_swz
tgsi_build_src_register_ext_swz(
   unsigned ext_swizzle_x,
   unsigned ext_swizzle_y,
   unsigned ext_swizzle_z,
   unsigned ext_swizzle_w,
   unsigned negate_x,
   unsigned negate_y,
   unsigned negate_z,
   unsigned negate_w,
   struct tgsi_token *prev_token,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_src_register_ext_swz src_register_ext_swz;

   assert( ext_swizzle_x <= TGSI_EXTSWIZZLE_ONE );
   assert( ext_swizzle_y <= TGSI_EXTSWIZZLE_ONE );
   assert( ext_swizzle_z <= TGSI_EXTSWIZZLE_ONE );
   assert( ext_swizzle_w <= TGSI_EXTSWIZZLE_ONE );
   assert( negate_x <= 1 );
   assert( negate_y <= 1 );
   assert( negate_z <= 1 );
   assert( negate_w <= 1 );

   src_register_ext_swz = tgsi_default_src_register_ext_swz();
   src_register_ext_swz.ExtSwizzleX = ext_swizzle_x;
   src_register_ext_swz.ExtSwizzleY = ext_swizzle_y;
   src_register_ext_swz.ExtSwizzleZ = ext_swizzle_z;
   src_register_ext_swz.ExtSwizzleW = ext_swizzle_w;
   src_register_ext_swz.NegateX = negate_x;
   src_register_ext_swz.NegateY = negate_y;
   src_register_ext_swz.NegateZ = negate_z;
   src_register_ext_swz.NegateW = negate_w;

   prev_token->Extended = 1;
   instruction_grow( instruction, header );

   return src_register_ext_swz;
}
Ejemplo n.º 17
0
static struct tgsi_ind_register
tgsi_build_ind_register(
   unsigned file,
   unsigned swizzle,
   int index,
   unsigned arrayid,
   struct tgsi_instruction *instruction,
   struct tgsi_header *header )
{
   struct tgsi_ind_register   ind_register;

   assert( file < TGSI_FILE_COUNT );
   assert( swizzle <= TGSI_SWIZZLE_W );
   assert( index >= -0x8000 && index <= 0x7FFF );

   ind_register.File = file;
   ind_register.Swizzle = swizzle;
   ind_register.Index = index;
   ind_register.ArrayID = arrayid;

   instruction_grow( instruction, header );

   return ind_register;
}
Ejemplo n.º 18
0
static struct tgsi_instruction_predicate
tgsi_build_instruction_predicate(int index,
                                 unsigned negate,
                                 unsigned swizzleX,
                                 unsigned swizzleY,
                                 unsigned swizzleZ,
                                 unsigned swizzleW,
                                 struct tgsi_instruction *instruction,
                                 struct tgsi_header *header)
{
   struct tgsi_instruction_predicate instruction_predicate;

   instruction_predicate = tgsi_default_instruction_predicate();
   instruction_predicate.SwizzleX = swizzleX;
   instruction_predicate.SwizzleY = swizzleY;
   instruction_predicate.SwizzleZ = swizzleZ;
   instruction_predicate.SwizzleW = swizzleW;
   instruction_predicate.Negate = negate;
   instruction_predicate.Index = index;

   instruction_grow(instruction, header);

   return instruction_predicate;
}