summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-20 18:45:14 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-20 18:45:14 -0600
commit3772441c498b997947f68e98830f72649bbc8442 (patch)
tree35d306d7532bd4c038a3bfb44c614f0c122167ad /src
parent79b8f97457a9634df28ba0def4623dbe2b142f09 (diff)
move ALIGN16-related macros into p_compiler.h
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/draw/draw_arrays.c10
-rw-r--r--src/mesa/pipe/p_compiler.h10
-rwxr-xr-xsrc/mesa/pipe/softpipe/sp_quad_fs.c27
3 files changed, 14 insertions, 33 deletions
diff --git a/src/mesa/pipe/draw/draw_arrays.c b/src/mesa/pipe/draw/draw_arrays.c
index 34a031ddf0..9b1426d1ec 100644
--- a/src/mesa/pipe/draw/draw_arrays.c
+++ b/src/mesa/pipe/draw/draw_arrays.c
@@ -50,16 +50,6 @@
#define VERT_RESULT_MAX 24
-#if defined __GNUC__
-#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE] __attribute__(( aligned( 16 ) ))
-#define ALIGN16_ASSIGN(P) P
-#else
-#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE + 1]
-#define ALIGN16_ASSIGN(P) align16(P)
-#endif
-
-
-
static INLINE unsigned
compute_clipmask(float cx, float cy, float cz, float cw)
{
diff --git a/src/mesa/pipe/p_compiler.h b/src/mesa/pipe/p_compiler.h
index d139cb1844..a4d05f74cd 100644
--- a/src/mesa/pipe/p_compiler.h
+++ b/src/mesa/pipe/p_compiler.h
@@ -68,4 +68,14 @@ typedef unsigned long long uint64;
#endif
+#if defined __GNUC__
+#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE] __attribute__(( aligned( 16 ) ))
+#define ALIGN16_ASSIGN(P) P
+#else
+#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE + 1]
+#define ALIGN16_ASSIGN(P) align16(P)
+#endif
+
+
+
#endif /* P_COMPILER_H */
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c
index c2decfecf8..c20f09d309 100755
--- a/src/mesa/pipe/softpipe/sp_quad_fs.c
+++ b/src/mesa/pipe/softpipe/sp_quad_fs.c
@@ -40,15 +40,6 @@
#include "sp_tex_sample.h"
-#if defined __GNUC__
-#define USE_ALIGNED_ATTRIBS 1
-#define ALIGN16_SUFFIX __attribute__(( aligned( 16 ) ))
-#else
-#define USE_ALIGNED_ATTRIBS 0
-#define ALIGN16_SUFFIX
-#endif
-
-
struct quad_shade_stage
{
struct quad_stage stage;
@@ -77,13 +68,8 @@ shade_quad(
const float fy = (float) quad->y0;
struct tgsi_exec_machine machine;
-#if USE_ALIGNED_ATTRIBS
- struct tgsi_exec_vector inputs[PIPE_ATTRIB_MAX] ALIGN16_SUFFIX;
- struct tgsi_exec_vector outputs[PIPE_ATTRIB_MAX] ALIGN16_SUFFIX;
-#else
- struct tgsi_exec_vector inputs[PIPE_ATTRIB_MAX + 1];
- struct tgsi_exec_vector outputs[PIPE_ATTRIB_MAX + 1];
-#endif
+ ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_ATTRIB_MAX);
+ ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_ATTRIB_MAX);
#ifdef DEBUG
memset( &machine, 0, sizeof( machine ) );
@@ -99,13 +85,8 @@ shade_quad(
/* Consts does not require 16 byte alignment. */
machine.Consts = softpipe->fs.constants->constant;
-#if USE_ALIGNED_ATTRIBS
- machine.Inputs = inputs;
- machine.Outputs = outputs;
-#else
- machine.Inputs = (struct tgsi_exec_vector *) tgsi_align_128bit( inputs );
- machine.Outputs = (struct tgsi_exec_vector *) tgsi_align_128bit( outputs );
-#endif
+ machine.Inputs = ALIGN16_ASSIGN(inputs);
+ machine.Outputs = ALIGN16_ASSIGN(outputs);
machine.InterpCoefs = quad->coef;