}
-void
+void
ureg_emit_src( struct ureg_program *ureg,
struct ureg_src src )
{
- unsigned size = 1 + (src.Indirect ? 1 : 0) + (src.Dimension ? 1 : 0);
+ unsigned size = 1 + (src.Indirect ? 1 : 0) +
+ (src.Dimension ? (src.DimIndirect ? 2 : 1) : 0);
union tgsi_any_token *out = get_tokens( ureg, DOMAIN_INSN, size );
unsigned n = 0;
}
if (src.Dimension) {
- out[0].src.Dimension = 1;
- out[n].dim.Indirect = 0;
- out[n].dim.Dimension = 0;
- out[n].dim.Padding = 0;
- out[n].dim.Index = src.DimensionIndex;
+ if (src.DimIndirect) {
+ out[0].src.Dimension = 1;
+ out[n].dim.Indirect = 1;
+ out[n].dim.Dimension = 0;
+ out[n].dim.Padding = 0;
+ out[n].dim.Index = src.DimensionIndex;
+ n++;
+ out[n].value = 0;
+ out[n].src.File = src.DimIndFile;
+ out[n].src.SwizzleX = src.DimIndSwizzle;
+ out[n].src.SwizzleY = src.DimIndSwizzle;
+ out[n].src.SwizzleZ = src.DimIndSwizzle;
+ out[n].src.SwizzleW = src.DimIndSwizzle;
+ out[n].src.Index = src.DimIndIndex;
+ } else {
+ out[0].src.Dimension = 1;
+ out[n].dim.Indirect = 0;
+ out[n].dim.Dimension = 0;
+ out[n].dim.Padding = 0;
+ out[n].dim.Index = src.DimensionIndex;
+ }
n++;
}
assert(ureg->processor == TGSI_PROCESSOR_GEOMETRY);
emit_property(ureg,
- TGSI_PROPERTY_GS_MAX_VERTICES,
+ TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES,
ureg->property_gs_max_vertices);
}
}
+void ureg_free_tokens( const struct tgsi_token *tokens )
+{
+ FREE((struct tgsi_token *)tokens);
+}
+
+
struct ureg_program *ureg_create( unsigned processor )
{
struct ureg_program *ureg = CALLOC_STRUCT( ureg_program );