summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/spu/spu_vertex_shader.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-08-25 11:31:59 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-08-25 11:31:59 -0600
commit6ba9fb9b6693904054ad4e1506ba42e324334b0a (patch)
treefdbf892bfba9558b9e263406d739cf3d1517cac0 /src/gallium/drivers/cell/spu/spu_vertex_shader.c
parent60ac76175b6457ecc1cd8bd7a25cb79b2d529434 (diff)
cell: asst fixes to get driver building/running again.
Note that SPU vertex transformation is disabled at this time.
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_vertex_shader.c')
-rw-r--r--src/gallium/drivers/cell/spu/spu_vertex_shader.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_vertex_shader.c b/src/gallium/drivers/cell/spu/spu_vertex_shader.c
index a1e81975e6..f81d19fea1 100644
--- a/src/gallium/drivers/cell/spu/spu_vertex_shader.c
+++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.c
@@ -36,13 +36,35 @@
#include "pipe/p_state.h"
#include "pipe/p_shader_tokens.h"
-#include "spu_vertex_shader.h"
-#include "spu_exec.h"
+#include "util/u_math.h"
#include "draw/draw_private.h"
#include "draw/draw_context.h"
#include "cell/common.h"
+#include "spu_vertex_shader.h"
+#include "spu_exec.h"
#include "spu_main.h"
+
+#define MAX_VERTEX_SIZE ((2 + PIPE_MAX_SHADER_OUTPUTS) * 4 * sizeof(float))
+
+
+#define CLIP_RIGHT_BIT 0x01
+#define CLIP_LEFT_BIT 0x02
+#define CLIP_TOP_BIT 0x04
+#define CLIP_BOTTOM_BIT 0x08
+#define CLIP_FAR_BIT 0x10
+#define CLIP_NEAR_BIT 0x20
+
+
+static INLINE float
+dot4(const float *a, const float *b)
+{
+ return (a[0]*b[0] +
+ a[1]*b[1] +
+ a[2]*b[2] +
+ a[3]*b[3]);
+}
+
static INLINE unsigned
compute_clipmask(const float *clip, /*const*/ float plane[][4], unsigned nr)
{