diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-03-25 00:18:30 +0100 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-03-26 01:21:52 +0100 |
commit | 84a8347b9f6ef0c1b2519e9bd5fef2ce3c85afb7 (patch) | |
tree | 69faa69e239d4295b7f058475b625be9764ef6f9 /src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c | |
parent | bc88c95990f871a206a8fe93e7541f1f41841f7e (diff) |
draw: Use translate function instead of switch cases
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.c | 29 |
1 files changed, 4 insertions, 25 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 1aecb51077..389e2b105e 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -130,31 +130,10 @@ static void fse_prepare( struct draw_pt_middle_end *middle, unsigned dst_offset = 0; for (i = 0; i < vinfo->num_attribs; i++) { - unsigned emit_sz = 0; - - switch (vinfo->attrib[i].emit) { - case EMIT_4F: - emit_sz = 4 * sizeof(float); - break; - case EMIT_3F: - emit_sz = 3 * sizeof(float); - break; - case EMIT_2F: - emit_sz = 2 * sizeof(float); - break; - case EMIT_1F: - emit_sz = 1 * sizeof(float); - break; - case EMIT_1F_PSIZE: - emit_sz = 1 * sizeof(float); - break; - case EMIT_4UB: - emit_sz = 4 * sizeof(ubyte); - break; - default: - assert(0); - break; - } + unsigned emit_sz = draw_translate_vinfo_size(vinfo->attrib[i].emit); + + /* doesn't handle EMIT_OMIT */ + assert(emit_sz != 0); /* The elements in the key correspond to vertex shader output * numbers, not to positions in the hw vertex description -- |