summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_vertex.h
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-05-27 19:01:57 +0100
committerKeith Whitwell <[email protected]>2008-05-27 19:05:16 +0100
commit7b85ea19de09d4e7e077ca147528e90e52683690 (patch)
treeab0c88b6836be7c31b67b5384c3dc4018583cc81 /src/gallium/auxiliary/draw/draw_vertex.h
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_vertex.h')
-rw-r--r--src/gallium/auxiliary/draw/draw_vertex.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vertex.h b/src/gallium/auxiliary/draw/draw_vertex.h
index 6d8bac51384..16c65c43175 100644
--- a/src/gallium/auxiliary/draw/draw_vertex.h
+++ b/src/gallium/auxiliary/draw/draw_vertex.h
@@ -109,4 +109,25 @@ extern void draw_compute_vertex_size(struct vertex_info *vinfo);
void draw_dump_emitted_vertex(const struct vertex_info *vinfo,
const uint8_t *data);
+
+static INLINE unsigned draw_translate_vinfo_format(unsigned format )
+{
+ switch (format) {
+ case EMIT_1F:
+ case EMIT_1F_PSIZE:
+ return PIPE_FORMAT_R32_FLOAT;
+ case EMIT_2F:
+ return PIPE_FORMAT_R32G32_FLOAT;
+ case EMIT_3F:
+ return PIPE_FORMAT_R32G32B32_FLOAT;
+ case EMIT_4F:
+ return PIPE_FORMAT_R32G32B32A32_FLOAT;
+ case EMIT_4UB:
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
+ default:
+ return PIPE_FORMAT_NONE;
+ }
+}
+
+
#endif /* DRAW_VERTEX_H */