summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save.h
diff options
context:
space:
mode:
authorMarius Predut <marius.predut@intel.com>2015-02-25 09:49:45 -0700
committerBrian Paul <brianp@vmware.com>2015-02-25 16:35:49 -0700
commit1a93e7690dc90211164082d6a2d26d93da8127ef (patch)
tree85dea0aa989370fbd767eec2b243e37c8892b6b5 /src/mesa/vbo/vbo_save.h
parent47053464630888f819ef8cc44278f1a1220159b9 (diff)
downloadexternal_mesa3d-1a93e7690dc90211164082d6a2d26d93da8127ef.zip
external_mesa3d-1a93e7690dc90211164082d6a2d26d93da8127ef.tar.gz
external_mesa3d-1a93e7690dc90211164082d6a2d26d93da8127ef.tar.bz2
mesa: use fi_type in vertex attribute code
For 32-bit builds, floating point operations use x86 FPU registers, not SSE registers. If we're actually storing an integer in a float variable, the value might get modified when written to memory. This patch changes the VBO code to use the fi_type (float/int union) to store/copy vertex attributes. Also, this can improve performance on x86 because moving floats with integer registers instead of FP registers is faster. Neil Roberts review: - include changes on all places that are storing attribute values. - check with and without -O3 compiler flag. Brian Paul review: - use fi_type type instead gl_constant_value type - fix a bunch of nit-picks. - fix compiler warnings Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 Signed-off-by: Marius Predut <marius.predut@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/vbo/vbo_save.h')
-rw-r--r--src/mesa/vbo/vbo_save.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index fd26b5f..5b1ac81 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -40,7 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
struct vbo_save_copied_vtx {
- GLfloat buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS];
+ fi_type buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS];
GLuint nr;
};
@@ -69,7 +69,7 @@ struct vbo_save_vertex_list {
* Keep this in regular (non-VBO) memory to avoid repeated
* map/unmap of the VBO when updating GL current data.
*/
- GLfloat *current_data;
+ fi_type *current_data;
GLuint current_size;
GLuint buffer_offset;
@@ -107,7 +107,7 @@ struct vbo_save_vertex_list {
*/
struct vbo_save_vertex_store {
struct gl_buffer_object *bufferobj;
- GLfloat *buffer;
+ fi_type *buffer;
GLuint used;
GLuint refcount;
};
@@ -133,7 +133,7 @@ struct vbo_save_context {
GLboolean out_of_memory; /**< True if last VBO allocation failed */
- GLfloat *buffer;
+ fi_type *buffer;
GLuint count;
GLuint wrap_count;
GLuint replay_flags;
@@ -144,9 +144,9 @@ struct vbo_save_context {
struct vbo_save_vertex_store *vertex_store;
struct vbo_save_primitive_store *prim_store;
- GLfloat *buffer_ptr; /* cursor, points into buffer */
- GLfloat vertex[VBO_ATTRIB_MAX*4]; /* current values */
- GLfloat *attrptr[VBO_ATTRIB_MAX];
+ fi_type *buffer_ptr; /* cursor, points into buffer */
+ fi_type vertex[VBO_ATTRIB_MAX*4]; /* current values */
+ fi_type *attrptr[VBO_ATTRIB_MAX];
GLuint vert_count;
GLuint max_vert;
GLboolean dangling_attr_ref;
@@ -155,7 +155,7 @@ struct vbo_save_context {
struct vbo_save_copied_vtx copied;
- GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->ListState */
+ fi_type *current[VBO_ATTRIB_MAX]; /* points into ctx->ListState */
GLubyte *currentsz[VBO_ATTRIB_MAX];
};
@@ -186,7 +186,7 @@ void vbo_save_playback_vertex_list( struct gl_context *ctx, void *data );
void vbo_save_api_init( struct vbo_save_context *save );
-GLfloat *
+fi_type *
vbo_save_map_vertex_store(struct gl_context *ctx,
struct vbo_save_vertex_store *vertex_store);