setup->last_fence->issued = TRUE;
pipe_mutex_lock(screen->rast_mutex);
+
+ /* FIXME: We enqueue the scene then wait on the rasterizer to finish.
+ * This means we never actually run any vertex stuff in parallel to
+ * rasterization (not in the same context at least) which is what the
+ * multiple scenes per setup is about - when we get a new empty scene
+ * any old one is already empty again because we waited here for
+ * raster tasks to be finished. Ideally, we shouldn't need to wait here
+ * and rely on fences elsewhere when waiting is necessary.
+ * Certainly, lp_scene_end_rasterization() would need to be deferred too
+ * and there's probably other bits why this doesn't actually work.
+ */
lp_rast_queue_scene(screen->rast, scene);
lp_rast_finish(screen->rast);
pipe_mutex_unlock(screen->rast_mutex);
if (!lp_tex->dt) {
/* regular texture - setup array of mipmap level offsets */
- void *mip_ptr;
int j;
unsigned first_level = 0;
unsigned last_level = 0;
last_level = view->u.tex.last_level;
assert(first_level <= last_level);
assert(last_level <= res->last_level);
-
- /*
- * The complexity here should no longer be necessary.
- */
- mip_ptr = llvmpipe_get_texture_image_all(lp_tex, first_level,
- LP_TEX_USAGE_READ);
- jit_tex->base = lp_tex->linear_img.data;
+ jit_tex->base = lp_tex->tex_data;
}
else {
- mip_ptr = lp_tex->data;
- jit_tex->base = mip_ptr;
+ jit_tex->base = lp_tex->data;
}
- if ((LP_PERF & PERF_TEX_MEM) || !mip_ptr) {
- /* out of memory - use dummy tile memory */
- /* Note if using PERF_TEX_MEM will also skip tile conversion */
+ if (LP_PERF & PERF_TEX_MEM) {
+ /* use dummy tile memory */
jit_tex->base = lp_dummy_tile;
jit_tex->width = TILE_SIZE/8;
jit_tex->height = TILE_SIZE/8;
if (llvmpipe_resource_is_texture(res)) {
for (j = first_level; j <= last_level; j++) {
- mip_ptr = llvmpipe_get_texture_image_all(lp_tex, j,
- LP_TEX_USAGE_READ);
- jit_tex->mip_offsets[j] = (uint8_t *)mip_ptr - (uint8_t *)jit_tex->base;
- /*
- * could get mip offset directly but need call above to
- * invoke tiled->linear conversion.
- */
- assert(lp_tex->mip_offsets[j] == jit_tex->mip_offsets[j]);
+ jit_tex->mip_offsets[j] = lp_tex->mip_offsets[j];
jit_tex->row_stride[j] = lp_tex->row_stride[j];
jit_tex->img_stride[j] = lp_tex->img_stride[j];
}
if (res->target == PIPE_TEXTURE_1D_ARRAY ||
- res->target == PIPE_TEXTURE_2D_ARRAY) {
+ res->target == PIPE_TEXTURE_2D_ARRAY ||
+ res->target == PIPE_TEXTURE_CUBE_ARRAY) {
/*
* For array textures, we don't have first_layer, instead
* adjust last_layer (stored as depth) plus the mip level offsets
jit_tex->mip_offsets[j] += view->u.tex.first_layer *
lp_tex->img_stride[j];
}
+ if (res->target == PIPE_TEXTURE_CUBE_ARRAY) {
+ assert(jit_tex->depth % 6 == 0);
+ }
assert(view->u.tex.first_layer <= view->u.tex.last_layer);
assert(view->u.tex.last_layer < res->array_size);
}
/* probably don't really need to fill that out */
jit_tex->mip_offsets[0] = 0;
jit_tex->row_stride[0] = 0;
- jit_tex->row_stride[0] = 0;
+ jit_tex->img_stride[0] = 0;
/* everything specified in number of elements here. */
jit_tex->width = view->u.buf.last_element - view->u.buf.first_element + 1;