Commit c95dcc49 authored by Keith Whitwell's avatar Keith Whitwell Committed by Zack Rusin

remove usage of vertex_header

parent 7a8ad75c
......@@ -212,12 +212,6 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
case EMIT_1F:
feme->fetch[i].emit = emit_R32_FLOAT;
break;
case EMIT_HEADER:
feme->fetch[i].ptr = (const ubyte *)&zero;
feme->fetch[i].pitch = 0;
feme->fetch[i].fetch = fetch_R32_FLOAT;
feme->fetch[i].emit = emit_R32_FLOAT;
break;
case EMIT_1F_PSIZE:
feme->fetch[i].ptr = (const ubyte *)&feme->draw->rasterizer->point_size;
feme->fetch[i].pitch = 0;
......
......@@ -126,13 +126,6 @@ dump_emitted_vertex(const struct vertex_info *vinfo, const uint8_t *data)
case EMIT_OMIT:
debug_printf("EMIT_OMIT:");
break;
case EMIT_ALL:
assert(i == 0);
assert(j == 0);
debug_printf("EMIT_ALL:\t");
for(k = 0; k < vinfo->size*4; ++k)
debug_printf("%02x ", *data++);
break;
case EMIT_1F:
debug_printf("EMIT_1F:\t");
debug_printf("%f ", *(float *)data); data += sizeof(float);
......@@ -217,19 +210,6 @@ emit_vertex( struct vbuf_stage *vbuf,
case EMIT_OMIT:
/* no-op */
break;
case EMIT_ALL:
/* just copy the whole vertex as-is to the vbuf */
assert(i == 0);
assert(j == 0);
memcpy(vbuf->vertex_ptr, vertex, vinfo->size * 4);
vbuf->vertex_ptr += vinfo->size;
count += vinfo->size;
break;
case EMIT_HEADER:
memcpy(vbuf->vertex_ptr, vertex, sizeof(*vertex));
*vbuf->vertex_ptr += sizeof(*vertex) / 4;
count += sizeof(*vertex) / 4;
break;
case EMIT_1F:
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
count++;
......
......@@ -52,9 +52,6 @@ draw_compute_vertex_size(struct vertex_info *vinfo)
switch (vinfo->emit[i]) {
case EMIT_OMIT:
break;
case EMIT_HEADER:
vinfo->size += sizeof(struct vertex_header) / 4;
break;
case EMIT_4UB:
/* fall-through */
case EMIT_1F_PSIZE:
......@@ -71,8 +68,6 @@ draw_compute_vertex_size(struct vertex_info *vinfo)
case EMIT_4F:
vinfo->size += 4;
break;
case EMIT_ALL:
/* fall-through */
default:
assert(0);
}
......
......@@ -47,8 +47,6 @@
*/
enum attrib_emit {
EMIT_OMIT, /**< don't emit the attribute */
EMIT_ALL, /**< emit whole post-xform vertex, w/ header */
EMIT_HEADER, /**< emit vertex_header struct (XXX temp?) */
EMIT_1F,
EMIT_1F_PSIZE, /**< insert constant point size */
EMIT_2F,
......
......@@ -205,7 +205,7 @@ void draw_vf_set_vertex_info( struct draw_vertex_fetch *vf,
const struct vertex_info *vinfo,
float point_size )
{
unsigned i, j, k;
unsigned i, j;
struct draw_vf_attr *a = vf->attr;
struct draw_vf_attr_map attrs[PIPE_MAX_SHADER_INPUTS];
unsigned count = 0; /* for debug/sanity */
......@@ -217,60 +217,6 @@ void draw_vf_set_vertex_info( struct draw_vertex_fetch *vf,
case EMIT_OMIT:
/* no-op */
break;
case EMIT_ALL: {
/* just copy the whole vertex as-is to the vbuf */
unsigned s = vinfo->size;
assert(i == 0);
assert(j == 0);
/* copy the vertex header */
/* XXX: we actually don't copy the header, just pad it */
attrs[nr_attrs].attrib = 0;
attrs[nr_attrs].format = DRAW_EMIT_PAD;
attrs[nr_attrs].offset = offsetof(struct vertex_header, data);
s -= offsetof(struct vertex_header, data)/4;
count += offsetof(struct vertex_header, data)/4;
nr_attrs++;
/* copy the vertex data */
for(k = 0; k < (s & ~0x3); k += 4) {
attrs[nr_attrs].attrib = k/4;
attrs[nr_attrs].format = DRAW_EMIT_4F;
attrs[nr_attrs].offset = 0;
nr_attrs++;
count += 4;
}
/* tail */
/* XXX: actually, this shouldn't be needed */
attrs[nr_attrs].attrib = k/4;
attrs[nr_attrs].offset = 0;
switch(s & 0x3) {
case 0:
break;
case 1:
attrs[nr_attrs].format = DRAW_EMIT_1F;
nr_attrs++;
count += 1;
break;
case 2:
attrs[nr_attrs].format = DRAW_EMIT_2F;
nr_attrs++;
count += 2;
break;
case 3:
attrs[nr_attrs].format = DRAW_EMIT_3F;
nr_attrs++;
count += 3;
break;
}
break;
}
case EMIT_HEADER:
/* XXX emit new DRAW_EMIT_HEADER attribute??? */
attrs[nr_attrs].attrib = 0;
attrs[nr_attrs].format = DRAW_EMIT_PAD;
attrs[nr_attrs].offset = offsetof(struct vertex_header, data);
count += offsetof(struct vertex_header, data)/4;
nr_attrs++;
break;
case EMIT_1F:
attrs[nr_attrs].attrib = j;
attrs[nr_attrs].format = DRAW_EMIT_1F;
......
......@@ -27,6 +27,7 @@ C_SOURCES = \
sp_quad_stencil.c \
sp_quad_stipple.c \
sp_screen.c \
sp_setup.c \
sp_state_blend.c \
sp_state_clip.c \
sp_state_derived.c \
......
......@@ -14,6 +14,7 @@ softpipe = env.ConvenienceLibrary(
'sp_flush.c',
'sp_prim_setup.c',
'sp_prim_vbuf.c',
'sp_setup.c',
'sp_quad_alpha_test.c',
'sp_quad_blend.c',
'sp_quad.c',
......
......@@ -69,6 +69,12 @@ typedef void (*vbuf_draw_func)( struct pipe_context *pipe,
extern struct draw_stage *
sp_draw_render_stage( struct softpipe_context *softpipe );
extern struct setup_context *
sp_draw_setup_context( struct draw_stage * );
extern void
sp_draw_flush( struct draw_stage * );
extern struct draw_stage *
sp_draw_vbuf_stage( struct draw_context *draw_context,
......
This diff is collapsed.
This diff is collapsed.
/**************************************************************************
*
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef SP_SETUP_H
#define SP_SETUP_H
struct setup_context;
struct softpipe_context;
void setup_tri( struct setup_context *setup,
float det,
const float (*v0)[4],
const float (*v1)[4],
const float (*v2)[4] );
void
setup_line(struct setup_context *setup,
const float (*v0)[4],
const float (*v1)[4]);
void
setup_point( struct setup_context *setup,
const float (*v0)[4] );
struct setup_context *setup_create_context( struct softpipe_context *softpipe );
void setup_prepare( struct setup_context *setup );
void setup_destroy_context( struct setup_context *setup );
#endif
......@@ -71,25 +71,16 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
* simply emit the whole post-xform vertex as-is:
*/
struct vertex_info *vinfo_vbuf = &softpipe->vertex_info_vbuf;
#if 0
vinfo_vbuf->num_attribs = 0;
/* special-case to allow memcpy of whole vertex */
draw_emit_vertex_attr(vinfo_vbuf, EMIT_ALL, INTERP_NONE, 0);
/* size in dwords or floats */
vinfo_vbuf->size = 4 * draw_num_vs_outputs(softpipe->draw)
+ sizeof(struct vertex_header) / 4;
#else
/* for pass-through mode, we need a more explicit list of attribs */
const uint num = draw_num_vs_outputs(softpipe->draw);
uint i;
/* No longer any need to try and emit draw vertex_header info.
*/
vinfo_vbuf->num_attribs = 0;
draw_emit_vertex_attr(vinfo_vbuf, EMIT_HEADER, INTERP_NONE, 0);
for (i = 0; i < num; i++) {
draw_emit_vertex_attr(vinfo_vbuf, EMIT_4F, INTERP_PERSPECTIVE, i);
}
draw_compute_vertex_size(vinfo_vbuf);
#endif
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment