* Helper for emitting temporary register declarations.
*/
static inline void
-tgsi_transform_temp_decl(struct tgsi_transform_context *ctx,
- unsigned index)
+tgsi_transform_temps_decl(struct tgsi_transform_context *ctx,
+ unsigned firstIdx, unsigned lastIdx)
{
struct tgsi_full_declaration decl;
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
- decl.Range.First =
- decl.Range.Last = index;
+ decl.Range.First = firstIdx;
+ decl.Range.Last = lastIdx;
ctx->emit_declaration(ctx, &decl);
}
+static inline void
+tgsi_transform_temp_decl(struct tgsi_transform_context *ctx,
+ unsigned index)
+{
+ tgsi_transform_temps_decl(ctx, index, index);
+}
static inline void
+tgsi_transform_const_decl(struct tgsi_transform_context *ctx,
+ unsigned firstIdx, unsigned lastIdx)
+{
+ struct tgsi_full_declaration decl;
+
+ decl = tgsi_default_full_declaration();
+ decl.Declaration.File = TGSI_FILE_CONSTANT;
+ decl.Range.First = firstIdx;
+ decl.Range.Last = lastIdx;
+ ctx->emit_declaration(ctx, &decl);
+}
+
+static inline void
tgsi_transform_input_decl(struct tgsi_transform_context *ctx,
unsigned index,
unsigned sem_name, unsigned sem_index,
ctx->emit_declaration(ctx, &decl);
}
+static inline void
+tgsi_transform_output_decl(struct tgsi_transform_context *ctx,
+ unsigned index,
+ unsigned sem_name, unsigned sem_index,
+ unsigned interp)
+{
+ struct tgsi_full_declaration decl;
+
+ decl = tgsi_default_full_declaration();
+ decl.Declaration.File = TGSI_FILE_OUTPUT;
+ decl.Declaration.Interpolate = 1;
+ decl.Declaration.Semantic = 1;
+ decl.Semantic.Name = sem_name;
+ decl.Semantic.Index = sem_index;
+ decl.Range.First =
+ decl.Range.Last = index;
+ decl.Interp.Interpolate = interp;
+
+ ctx->emit_declaration(ctx, &decl);
+}
static inline void
tgsi_transform_sampler_decl(struct tgsi_transform_context *ctx,
ctx->emit_immediate(ctx, &immed);
}
+static inline void
+tgsi_transform_dst_reg(struct tgsi_full_dst_register *reg,
+ unsigned file, unsigned index, unsigned writemask)
+{
+ reg->Register.File = file;
+ reg->Register.Index = index;
+ reg->Register.WriteMask = writemask;
+}
+
+static inline void
+tgsi_transform_src_reg(struct tgsi_full_src_register *reg,
+ unsigned file, unsigned index,
+ unsigned swizzleX, unsigned swizzleY,
+ unsigned swizzleZ, unsigned swizzleW)
+{
+ reg->Register.File = file;
+ reg->Register.Index = index;
+ reg->Register.SwizzleX = swizzleX;
+ reg->Register.SwizzleY = swizzleY;
+ reg->Register.SwizzleZ = swizzleZ;
+ reg->Register.SwizzleW = swizzleW;
+}
/**
* Helper for emitting 1-operand instructions.