summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-27 19:01:57 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-27 19:05:16 +0100
commit7b85ea19de09d4e7e077ca147528e90e52683690 (patch)
treeab0c88b6836be7c31b67b5384c3dc4018583cc81 /src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
parentfd20d1c7e8bbe2f40d73679b1514023772cfd8f6 (diff)
draw: support psize in vs_varient paths
Preserve the vinfo "EMIT_*" format descriptors in the varient key, and deal with PSIZE directly in each implementation.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
index 85d0bdfcab..729c7db999 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
@@ -77,7 +77,6 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
unsigned num_vs_inputs = draw->vs.vertex_shader->info.num_inputs;
const struct vertex_info *vinfo;
unsigned i;
- boolean need_psize = 0;
if (!draw->render->set_primitive( draw->render,
@@ -123,34 +122,24 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
for (i = 0; i < vinfo->num_attribs; i++) {
unsigned emit_sz = 0;
- unsigned output_format = PIPE_FORMAT_NONE;
- unsigned vs_output = vinfo->src_index[i];
switch (vinfo->emit[i]) {
case EMIT_4F:
- output_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
emit_sz = 4 * sizeof(float);
break;
case EMIT_3F:
- output_format = PIPE_FORMAT_R32G32B32_FLOAT;
emit_sz = 3 * sizeof(float);
break;
case EMIT_2F:
- output_format = PIPE_FORMAT_R32G32_FLOAT;
emit_sz = 2 * sizeof(float);
break;
case EMIT_1F:
- output_format = PIPE_FORMAT_R32_FLOAT;
emit_sz = 1 * sizeof(float);
break;
case EMIT_1F_PSIZE:
- need_psize = 1;
- output_format = PIPE_FORMAT_R32_FLOAT;
emit_sz = 1 * sizeof(float);
- vs_output = vinfo->num_attribs + 1;
break;
case EMIT_4UB:
- output_format = PIPE_FORMAT_B8G8R8A8_UNORM;
emit_sz = 4 * sizeof(ubyte);
break;
default:
@@ -162,33 +151,15 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
* numbers, not to positions in the hw vertex description --
* that's handled by the output_offset field.
*/
- fse->key.element[vs_output].out.format = output_format;
- fse->key.element[vs_output].out.vs_output = vs_output;
- fse->key.element[vs_output].out.offset = dst_offset;
+ fse->key.element[i].out.format = vinfo->emit[i];
+ fse->key.element[i].out.vs_output = vinfo->src_index[i];
+ fse->key.element[i].out.offset = dst_offset;
dst_offset += emit_sz;
assert(fse->key.output_stride >= dst_offset);
}
}
- /* To make psize work, really need to tell the vertex shader to
- * copy that value from input->output. For 'translate' this was
- * implicit for all elements.
- */
-#if 0
- if (need_psize) {
- unsigned input = num_vs_inputs + 1;
- const struct pipe_vertex_element *src = &draw->pt.vertex_element[i];
- fse->key.element[i].input_format = PIPE_FORMAT_R32_FLOAT;
- fse->key.element[i].input_buffer = 0; //nr_buffers + 1;
- fse->key.element[i].input_offset = 0;
-
- fse->key.nr_inputs += 1;
- fse->key.nr_elements = MAX2(fse->key.nr_inputs,
- fse->key.nr_outputs);
-
- }
-#endif
/* Would normally look up a vertex shader and peruse its list of
* varients somehow. We omitted that step and put all the