zsbuf->zslice,
LP_TEX_USAGE_READ_WRITE,
LP_TEX_LAYOUT_NONE);
- assert(rast->zsbuf.map);
}
lp_scene_bin_iter_begin( scene );
/* Get actual pointer to the tile data. Note that depth/stencil
* data is tiled differently than color data.
*/
- task->depth_tile = lp_rast_get_depth_block_pointer(rast, x, y);
+ task->depth_tile = lp_rast_get_depth_block_pointer(task, x, y);
assert(task->depth_tile);
}
dst = task->depth_tile;
- assert(dst == lp_rast_get_depth_block_pointer(rast, task->x, task->y));
+ if (lp_is_dummy_tile(dst))
+ return;
+
+ assert(dst == lp_rast_get_depth_block_pointer(task, task->x, task->y));
switch (block_size) {
case 1:
tile_x + x, tile_y + y);
/* depth buffer */
- depth = lp_rast_get_depth_block_pointer(rast, tile_x + x, tile_y + y);
+ depth = lp_rast_get_depth_block_pointer(task, tile_x + x, tile_y + y);
/* run shader on 4x4 block */
variant->jit_function[RAST_WHOLE]( &state->jit_context,
}
/* depth buffer */
- depth = lp_rast_get_depth_block_pointer(rast, x, y);
+ depth = lp_rast_get_depth_block_pointer(task, x, y);
assert(lp_check_alignment(state->jit_context.blend_color, 16));
#include "os/os_thread.h"
#include "util/u_format.h"
#include "gallivm/lp_bld_debug.h"
+#include "lp_memory.h"
#include "lp_rast.h"
#include "lp_scene.h"
#include "lp_state.h"
* \param x, y location of 4x4 block in window coords
*/
static INLINE void *
-lp_rast_get_depth_block_pointer(const struct lp_rasterizer *rast,
+lp_rast_get_depth_block_pointer(struct lp_rasterizer_task *task,
unsigned x, unsigned y)
{
+ const struct lp_rasterizer *rast = task->rast;
void *depth;
assert((x % TILE_VECTOR_WIDTH) == 0);
assert((y % TILE_VECTOR_HEIGHT) == 0);
- assert(rast->zsbuf.map || !rast->curr_scene->fb.zsbuf);
-
- if (!rast->zsbuf.map)
- return NULL;
+ if (!rast->zsbuf.map && (task->current_state->variant->key.depth.enabled ||
+ task->current_state->variant->key.stencil[0].enabled)) {
+ /* out of memory - use dummy tile memory */
+ return lp_get_dummy_tile();
+ }
depth = (rast->zsbuf.map +
rast->zsbuf.stride * y +
assert((y % TILE_VECTOR_HEIGHT) == 0);
color = task->color_tiles[buf];
- if (!color)
- return NULL;
+ if (!color) {
+ /* out of memory - use dummy tile memory */
+ return lp_get_dummy_tile();
+ }
px = x % TILE_SIZE;
py = y % TILE_SIZE;
const struct lp_rast_shader_inputs *inputs,
unsigned x, unsigned y )
{
- struct lp_rasterizer *rast = task->rast;
+ const struct lp_rasterizer *rast = task->rast;
const struct lp_rast_state *state = task->current_state;
struct lp_fragment_shader_variant *variant = state->variant;
uint8_t *color[PIPE_MAX_COLOR_BUFS];
for (i = 0; i < rast->state.nr_cbufs; i++)
color[i] = lp_rast_get_color_block_pointer(task, i, x, y);
- depth = lp_rast_get_depth_block_pointer(rast, x, y);
+ depth = lp_rast_get_depth_block_pointer(task, x, y);
/* run shader on 4x4 block */
variant->jit_function[RAST_WHOLE]( &state->jit_context,
#include "util/u_memory.h"
#include "util/u_pack_color.h"
#include "lp_context.h"
+#include "lp_memory.h"
#include "lp_scene.h"
#include "lp_scene_queue.h"
#include "lp_texture.h"
LP_TEX_LAYOUT_LINEAR);
jit_tex->row_stride[j] = lp_tex->row_stride[j];
jit_tex->img_stride[j] = lp_tex->img_stride[j];
+
+ if (!jit_tex->data[j]) {
+ /* out of memory - use dummy tile memory */
+ jit_tex->data[j] = lp_get_dummy_tile();
+ jit_tex->width = TILE_SIZE;
+ jit_tex->height = TILE_SIZE;
+ jit_tex->depth = 1;
+ jit_tex->last_level = 0;
+ jit_tex->row_stride[j] = 0;
+ jit_tex->img_stride[j] = 0;
+ }
}
}
else {