for (i = 0; i < nr_inputs; i++) {
if (i == instance_id_index) {
key.element[nr].type = TRANSLATE_ELEMENT_INSTANCE_ID;
- key.element[nr].input_format = PIPE_FORMAT_R32_FLOAT; /* XXX: Make it UINT. */
+ key.element[nr].input_format = PIPE_FORMAT_R32_USCALED;
+ key.element[nr].output_format = PIPE_FORMAT_R32_USCALED;
+ key.element[nr].output_offset = dst_offset;
+
+ dst_offset += sizeof(uint);
} else {
key.element[nr].type = TRANSLATE_ELEMENT_NORMAL;
key.element[nr].input_format = draw->pt.vertex_element[ei].src_format;
key.element[nr].input_buffer = draw->pt.vertex_element[ei].vertex_buffer_index;
key.element[nr].input_offset = draw->pt.vertex_element[ei].src_offset;
key.element[nr].instance_divisor = draw->pt.vertex_element[ei].instance_divisor;
+ key.element[nr].output_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ key.element[nr].output_offset = dst_offset;
+
ei++;
+ dst_offset += 4 * sizeof(float);
}
- key.element[nr].output_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- key.element[nr].output_offset = dst_offset;
- dst_offset += 4 * sizeof(float);
nr++;
}
unsigned start,
unsigned count,
unsigned instance_id,
- void *output_buffer,
- float instance_id_float );
+ void *output_buffer);
typedef void (PIPE_CDECL *run_elts_func)( struct translate *translate,
const unsigned *elts,
unsigned count,
unsigned instance_id,
- void *output_buffer,
- float instance_id_float );
+ void *output_buffer);
struct translate_buffer {
const void *base_ptr;
boolean use_instancing;
unsigned instance_id;
- float instance_id_float; /* XXX: needed while no integer support in TGSI */
run_func gen_run;
run_elts_func gen_run_elts;
{
if (var_idx == ELEMENT_BUFFER_INSTANCE_ID) {
return x86_make_disp(p->machine_EDX,
- get_offset(p, &p->instance_id_float));
+ get_offset(p, &p->instance_id));
}
if (linear && p->nr_buffer_varients == 1) {
return p->idx_EBX;
x86_mov(p->func,
x86_make_disp(p->machine_EDX, get_offset(p, &p->instance_id)),
p->tmp_EAX);
-
- /* XXX: temporary */
- x86_mov(p->func,
- p->tmp_EAX,
- x86_fn_arg(p->func, 6));
- x86_mov(p->func,
- x86_make_disp(p->machine_EDX, get_offset(p, &p->instance_id_float)),
- p->tmp_EAX);
}
/* Get vertex count, compare to zero
elts,
count,
instance_id,
- output_buffer,
- (float)instance_id );
+ output_buffer);
}
static void PIPE_CDECL translate_sse_run( struct translate *translate,
start,
count,
instance_id,
- output_buffer,
- (float)instance_id);
+ output_buffer);
}