summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_rast.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-09-29 11:07:24 +0100
committerJosé Fonseca <[email protected]>2011-09-29 17:44:06 +0100
commit1da10443440800a6f5e4a4e6463737cce27706fd (patch)
tree1973cbcf445e4de8c915fdfe687fde41abeaf539 /src/gallium/drivers/llvmpipe/lp_rast.c
parent8d647247e23a5f2d13923d13a58fc62e76c9a476 (diff)
llvmpipe: Convert some of the null checks back to asserts.
This turns some of the null check warnings in commit 023ca40d80670ac0eee8c755ca5f54b1e7c2712e back to asserts, as the underlying cause of fdo bug 40591 should be fixed now.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 2bb61fcc7c4..131785852c8 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -334,20 +334,11 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task,
{
const struct lp_scene *scene = task->scene;
const struct lp_rast_shader_inputs *inputs = arg.shade_tile;
- const struct lp_rast_state *state = task->state;
- struct lp_fragment_shader_variant *variant = state->variant;
+ const struct lp_rast_state *state;
+ struct lp_fragment_shader_variant *variant;
const unsigned tile_x = task->x, tile_y = task->y;
unsigned x, y;
- if (!variant) {
- static boolean warned = FALSE;
- if (!warned) {
- debug_warning("null variant pointer");
- warned = TRUE;
- }
- return;
- }
-
if (inputs->disable) {
/* This command was partially binned and has been disabled */
return;
@@ -355,6 +346,13 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task,
LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
+ state = task->state;
+ assert(state);
+ if (!state) {
+ return;
+ }
+ variant = state->variant;
+
/* render the whole 64x64 tile in 4x4 chunks */
for (y = 0; y < TILE_SIZE; y += 4){
for (x = 0; x < TILE_SIZE; x += 4) {
@@ -400,21 +398,13 @@ lp_rast_shade_tile_opaque(struct lp_rasterizer_task *task,
const struct lp_scene *scene = task->scene;
unsigned i;
+ LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
+
+ assert(task->state);
if (!task->state) {
- /* This indicates that some sort of rendering command was queued
- * before we set up the rasterization state. Just returning here
- * allows the piglit fbo-mipmap-copypix test to run/pass.
- */
- static boolean warned = FALSE;
- if (!warned) {
- debug_warning("null state pointer");
- warned = TRUE;
- }
return;
}
- LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
-
/* this will prevent converting the layout from tiled to linear */
for (i = 0; i < scene->fb.nr_cbufs; i++) {
(void)lp_rast_get_color_tile_pointer(task, i, LP_TEX_USAGE_WRITE_ALL);
@@ -807,10 +797,6 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data )
boolean debug = false;
while (1) {
- /* make sure these pointers aren't pointing to old data */
- task->scene = NULL;
- task->state = NULL;
-
/* wait for work */
if (debug)
debug_printf("thread %d waiting for work\n", task->thread_index);