if (cp.error)
goto fail;
- if (cp.vaos->base.key.viewport) {
- if (0)
- emit_viewport(&cp);
- else
- emit_rhw_viewport(&cp);
+ if (cp.vaos->base.key.clip) {
+ /* not really handling clipping, just do the rhw so we can
+ * see the results...
+ */
+ emit_rhw_viewport(&cp);
+ }
+ else if (cp.vaos->base.key.viewport) {
+ emit_viewport(&cp);
}
/* Emit output... TODO: do this eagerly after the last write to a
{
struct draw_vs_varient_aos_sse *vaos = CALLOC_STRUCT(draw_vs_varient_aos_sse);
- if (key->clip)
- return NULL;
-
if (!vaos)
goto fail;
/* Mainly for debug at this stage:
*/
-static void do_viewport( struct draw_vs_varient_generic *vsvg,
- unsigned count,
- void *output_buffer )
+static void do_rhw_viewport( struct draw_vs_varient_generic *vsvg,
+ unsigned count,
+ void *output_buffer )
{
char *ptr = (char *)output_buffer;
const float *scale = vsvg->viewport.scale;
data[3] = w;
}
}
+
+static void do_viewport( struct draw_vs_varient_generic *vsvg,
+ unsigned count,
+ void *output_buffer )
+{
+ char *ptr = (char *)output_buffer;
+ const float *scale = vsvg->viewport.scale;
+ const float *trans = vsvg->viewport.translate;
+ unsigned stride = vsvg->base.key.output_stride;
+ unsigned j;
+
+ for (j = 0; j < count; j++, ptr += stride) {
+ float *data = (float *)ptr;
+
+ data[0] = data[0] * scale[0] + trans[0];
+ data[1] = data[1] * scale[1] + trans[1];
+ data[2] = data[2] * scale[2] + trans[2];
+ }
+}
static void vsvg_run_elts( struct draw_vs_varient *varient,
vsvg->base.key.output_stride,
vsvg->base.key.output_stride);
- if (vsvg->base.key.viewport)
+
+ if (vsvg->base.key.clip) {
+ /* not really handling clipping, just do the rhw so we can
+ * see the results...
+ */
+ do_rhw_viewport( vsvg,
+ count,
+ output_buffer );
+ }
+ else if (vsvg->base.key.viewport) {
do_viewport( vsvg,
count,
output_buffer );
+ }
//if (!vsvg->already_in_emit_format)
vsvg->base.key.output_stride,
vsvg->base.key.output_stride);
- if (vsvg->base.key.viewport)
+ if (vsvg->base.key.clip) {
+ /* not really handling clipping, just do the rhw so we can
+ * see the results...
+ */
+ do_rhw_viewport( vsvg,
+ count,
+ output_buffer );
+ }
+ else if (vsvg->base.key.viewport) {
do_viewport( vsvg,
count,
output_buffer );
-
+ }
//if (!vsvg->already_in_emit_format)
vsvg->emit->set_buffer( vsvg->emit,
unsigned i;
struct translate_key fetch, emit;
- if (key->clip)
- return NULL;
-
struct draw_vs_varient_generic *vsvg = CALLOC_STRUCT( draw_vs_varient_generic );
if (vsvg == NULL)
return NULL;