summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-04-23 12:39:38 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-04-23 12:39:38 +1000
commit104ff59585ad1888c8cef5ad9de0e2fdb3f48c21 (patch)
tree9128984eef4a90cc6177d336759ce795b835d71f /src/gallium/drivers
parentb20acef90695d6e5975f538b6e9cb812b05f0cf6 (diff)
parent6fc530ccda2971a5d99a955ad90ae9762238040f (diff)
Merge branch 'upstream-gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_draw_arrays.c11
-rw-r--r--src/gallium/drivers/i915simple/i915_context.c2
-rw-r--r--src/gallium/drivers/i915simple/i915_prim_emit.c5
-rw-r--r--src/gallium/drivers/softpipe/sp_clear.c3
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c3
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h2
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c11
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_sse.c14
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_setup.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.c14
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c5
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c24
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c3
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c2
15 files changed, 53 insertions, 50 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
index 36af5be5f0..6e08cf6fe8 100644
--- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
+++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
@@ -101,17 +101,6 @@ cell_draw_elements(struct pipe_context *pipe,
struct draw_context *draw = sp->draw;
unsigned i;
- /* first, check that the primitive is not malformed. It is the
- * state tracker's responsibility to do send only correctly formed
- * primitives down. It currently isn't doing that though...
- */
-#if 1
- count = draw_trim_prim( mode, count );
-#else
- if (!draw_validate_prim( mode, count ))
- assert(0);
-#endif
-
if (sp->dirty)
cell_update_derived( sp );
diff --git a/src/gallium/drivers/i915simple/i915_context.c b/src/gallium/drivers/i915simple/i915_context.c
index 58a5854f0d..4bef21619c 100644
--- a/src/gallium/drivers/i915simple/i915_context.c
+++ b/src/gallium/drivers/i915simple/i915_context.c
@@ -142,7 +142,7 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
*/
i915->draw = draw_create();
assert(i915->draw);
- if (GETENV("I915_VBUF")) {
+ if (!GETENV("I915_NO_VBUF")) {
draw_set_rasterize_stage(i915->draw, i915_draw_vbuf_stage(i915));
}
else {
diff --git a/src/gallium/drivers/i915simple/i915_prim_emit.c b/src/gallium/drivers/i915simple/i915_prim_emit.c
index b6fb0a6d88..9ffa460138 100644
--- a/src/gallium/drivers/i915simple/i915_prim_emit.c
+++ b/src/gallium/drivers/i915simple/i915_prim_emit.c
@@ -26,7 +26,7 @@
**************************************************************************/
-#include "draw/draw_private.h"
+#include "draw/draw_pipe.h"
#include "pipe/p_util.h"
#include "i915_context.h"
@@ -78,9 +78,6 @@ emit_hw_vertex( struct i915_context *i915,
const uint j = vinfo->src_index[i];
const float *attrib = vertex->data[j];
switch (vinfo->emit[i]) {
- case EMIT_OMIT:
- /* no-op */
- break;
case EMIT_1F:
OUT_BATCH( fui(attrib[0]) );
count++;
diff --git a/src/gallium/drivers/softpipe/sp_clear.c b/src/gallium/drivers/softpipe/sp_clear.c
index 39aed151c7..1236706891 100644
--- a/src/gallium/drivers/softpipe/sp_clear.c
+++ b/src/gallium/drivers/softpipe/sp_clear.c
@@ -49,6 +49,9 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i;
+ if (softpipe->no_rast)
+ return;
+
#if 0
softpipe_update_derived(softpipe); /* not needed?? */
#endif
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 8c84ddbe19..200fb415ac 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -219,6 +219,9 @@ softpipe_create( struct pipe_screen *screen,
assert(softpipe->draw);
softpipe->setup = sp_draw_render_stage(softpipe);
+ if (GETENV( "SP_NO_RAST" ) != NULL)
+ softpipe->no_rast = TRUE;
+
if (GETENV( "SP_VBUF" ) != NULL) {
sp_init_vbuf(softpipe);
}
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 0e1d5e561d..b3e2b2e435 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -86,6 +86,8 @@ struct softpipe_context {
unsigned num_vertex_elements;
unsigned num_vertex_buffers;
+ boolean no_rast;
+
/* Counter for occlusion queries. Note this supports overlapping
* queries.
*/
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 421509495a..778291dded 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -118,17 +118,6 @@ softpipe_draw_elements(struct pipe_context *pipe,
struct draw_context *draw = sp->draw;
unsigned i;
- /* first, check that the primitive is not malformed. It is the
- * state tracker's responsibility to do send only correctly formed
- * primitives down. It currently isn't doing that though...
- */
-#if 1
- count = draw_trim_prim( mode, count );
-#else
- if (!draw_validate_prim( mode, count ))
- assert(0);
-#endif
-
sp->reduced_api_prim = reduced_prim[mode];
if (sp->dirty)
diff --git a/src/gallium/drivers/softpipe/sp_fs_sse.c b/src/gallium/drivers/softpipe/sp_fs_sse.c
index 5ef02a7142..f857d26143 100644
--- a/src/gallium/drivers/softpipe/sp_fs_sse.c
+++ b/src/gallium/drivers/softpipe/sp_fs_sse.c
@@ -49,7 +49,7 @@
typedef void (XSTDCALL *codegen_function)(
const struct tgsi_exec_vector *input,
struct tgsi_exec_vector *output,
- float (*constant)[4],
+ const float (*constant)[4],
struct tgsi_exec_vector *temporary,
const struct tgsi_interp_coef *coef,
float (*immediates)[4]
@@ -67,9 +67,9 @@ struct sp_sse_fragment_shader {
static void
-fs_sse_prepare( struct sp_fragment_shader *base,
- struct tgsi_exec_machine *machine,
- struct tgsi_sampler *samplers )
+fs_sse_prepare( const struct sp_fragment_shader *base,
+ struct tgsi_exec_machine *machine,
+ struct tgsi_sampler *samplers )
{
}
@@ -80,9 +80,9 @@ fs_sse_prepare( struct sp_fragment_shader *base,
* TODO: process >1 quad at a time
*/
static unsigned
-fs_sse_run( struct sp_fragment_shader *base,
- struct tgsi_exec_machine *machine,
- struct quad_header *quad )
+fs_sse_run( const struct sp_fragment_shader *base,
+ struct tgsi_exec_machine *machine,
+ struct quad_header *quad )
{
struct sp_sse_fragment_shader *shader = (struct sp_sse_fragment_shader *) base;
diff --git a/src/gallium/drivers/softpipe/sp_prim_setup.c b/src/gallium/drivers/softpipe/sp_prim_setup.c
index 0ddb06764a..feb35d492a 100644
--- a/src/gallium/drivers/softpipe/sp_prim_setup.c
+++ b/src/gallium/drivers/softpipe/sp_prim_setup.c
@@ -39,7 +39,7 @@
#include "sp_setup.h"
#include "sp_state.h"
#include "sp_prim_setup.h"
-#include "draw/draw_private.h"
+#include "draw/draw_pipe.h"
#include "draw/draw_vertex.h"
#include "pipe/p_util.h"
diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index 4fed19ecb6..e063fe82ef 100644
--- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
@@ -106,6 +106,16 @@ static boolean
sp_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim)
{
struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
+
+ /* XXX: break this dependency - make setup_context live under
+ * softpipe, rename the old "setup" draw stage to something else.
+ */
+ struct setup_context *setup_ctx = sp_draw_setup_context(cvbr->softpipe->setup);
+
+ setup_prepare( setup_ctx );
+
+
+
if (prim == PIPE_PRIM_TRIANGLES ||
prim == PIPE_PRIM_LINES ||
prim == PIPE_PRIM_POINTS) {
@@ -136,10 +146,6 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr_indices)
*/
struct draw_stage *setup = softpipe->setup;
struct setup_context *setup_ctx = sp_draw_setup_context(softpipe->setup);
-
- /* XXX: call this from allocate_vertices:
- */
- setup_prepare( setup_ctx );
switch (cvbr->prim) {
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index 8dbdbe5764..625d0f9b48 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -77,7 +77,8 @@ shade_quad(
struct quad_shade_stage *qss = quad_shade_stage( qs );
struct softpipe_context *softpipe = qs->softpipe;
struct tgsi_exec_machine *machine = &qss->machine;
-
+ boolean z_written;
+
/* Consts do not require 16 byte alignment. */
machine->Consts = softpipe->mapped_constants[PIPE_SHADER_FRAGMENT];
@@ -89,7 +90,7 @@ shade_quad(
quad );
/* store outputs */
- boolean z_written = FALSE;
+ z_written = FALSE;
{
const ubyte *sem_name = softpipe->fs->info.output_semantic_name;
const ubyte *sem_index = softpipe->fs->info.output_semantic_index;
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index 813d703108..7df8fc5f67 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -299,13 +299,6 @@ static boolean setup_sort_vertices( struct setup_context *setup,
const float (*v1)[4],
const float (*v2)[4] )
{
-#if DEBUG_VERTS
- debug_printf("Triangle:\n");
- print_vertex(setup, v0);
- print_vertex(setup, v1);
- print_vertex(setup, v2);
-#endif
-
setup->vprovoke = v2;
/* determine bottom to top order of vertices */
@@ -726,6 +719,9 @@ void setup_tri( struct setup_context *setup,
{
float det = calc_det(v0, v1, v2);
+ if (setup->softpipe->no_rast)
+ return;
+
/*
debug_printf("%s\n", __FUNCTION__ );
*/
@@ -735,7 +731,12 @@ void setup_tri( struct setup_context *setup,
setup->numFragsWritten = 0;
#endif
-
+#if DEBUG_VERTS
+ debug_printf("Triangle:\n");
+ print_vertex(setup, v0);
+ print_vertex(setup, v1);
+ print_vertex(setup, v2);
+#endif
if (cull_tri( setup, det ))
return;
@@ -934,6 +935,9 @@ setup_line(struct setup_context *setup,
int dy = y1 - y0;
int xstep, ystep;
+ if (setup->softpipe->no_rast)
+ return;
+
if (dx == 0 && dy == 0)
return;
@@ -1052,6 +1056,10 @@ setup_point( struct setup_context *setup,
const struct vertex_info *vinfo = softpipe_get_vertex_info(softpipe);
uint fragSlot;
+
+ if (softpipe->no_rast)
+ return;
+
/* For points, all interpolants are constant-valued.
* However, for point sprites, we'll need to setup texcoords appropriately.
* XXX: which coefficients are the texcoords???
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index 4eefd1d61f..2921066ce3 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -82,7 +82,10 @@ softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
void
softpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
struct sp_fragment_shader *state = fs;
+
+ assert(fs != softpipe->fs);
state->delete( state );
}
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 34da6356d7..5b63f97997 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -651,7 +651,9 @@ shadow_compare(uint compare_func,
k = 0;
break;
default:
+ k = 0;
assert(0);
+ break;
}
rgba[0][j] = rgba[1][j] = rgba[2][j] = (float) k;
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 19f71887e7..edafd93d8b 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -39,7 +39,7 @@
#include "sp_surface.h"
#include "sp_tile_cache.h"
-#define NUM_ENTRIES 30
+#define NUM_ENTRIES 32
/** XXX move these */