Rev 4358 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4358 | Rev 4401 | ||
---|---|---|---|
Line 320... | Line 320... | ||
320 | tex->format = new_format; |
320 | tex->format = new_format; |
321 | rtex->surface.level[0].npix_x = util_format_get_nblocksx(orig->format, orig->npix0_x); |
321 | rtex->surface.level[0].npix_x = util_format_get_nblocksx(orig->format, orig->npix0_x); |
322 | rtex->surface.level[0].npix_y = util_format_get_nblocksy(orig->format, orig->npix0_y); |
322 | rtex->surface.level[0].npix_y = util_format_get_nblocksy(orig->format, orig->npix0_y); |
323 | rtex->surface.level[level].npix_x = util_format_get_nblocksx(orig->format, orig->npix_x); |
323 | rtex->surface.level[level].npix_x = util_format_get_nblocksx(orig->format, orig->npix_x); |
324 | rtex->surface.level[level].npix_y = util_format_get_nblocksy(orig->format, orig->npix_y); |
324 | rtex->surface.level[level].npix_y = util_format_get_nblocksy(orig->format, orig->npix_y); |
- | 325 | ||
- | 326 | /* By dividing the dimensions by 4, we effectively decrement |
|
- | 327 | * last_level by 2, therefore the last 2 mipmap levels disappear and |
|
- | 328 | * aren't blittable. Note that the last 3 mipmap levels (4x4, 2x2, |
|
- | 329 | * 1x1) have equal slice sizes, which is an important assumption |
|
- | 330 | * for this to work. |
|
- | 331 | * |
|
- | 332 | * In order to make the last 2 mipmap levels blittable, we have to |
|
- | 333 | * add the slice size of the last mipmap level to the texture |
|
- | 334 | * address, so that even though the hw thinks it reads last_level-2, |
|
- | 335 | * it will actually read last_level-1, and if we add the slice size*2, |
|
- | 336 | * it will read last_level. That's how this workaround works. |
|
- | 337 | */ |
|
- | 338 | if (level > rtex->resource.b.b.last_level-2) |
|
- | 339 | rtex->mipmap_shift = level - (rtex->resource.b.b.last_level-2); |
|
325 | } |
340 | } |
Line 326... | Line 341... | ||
326 | 341 | ||
327 | static void r600_change_format(struct pipe_resource *tex, |
342 | static void r600_change_format(struct pipe_resource *tex, |
328 | unsigned level, |
343 | unsigned level, |
Line 353... | Line 368... | ||
353 | tex->height0 = orig->height0; |
368 | tex->height0 = orig->height0; |
354 | rtex->surface.level[0].npix_x = orig->npix0_x; |
369 | rtex->surface.level[0].npix_x = orig->npix0_x; |
355 | rtex->surface.level[0].npix_y = orig->npix0_y; |
370 | rtex->surface.level[0].npix_y = orig->npix0_y; |
356 | rtex->surface.level[level].npix_x = orig->npix_x; |
371 | rtex->surface.level[level].npix_x = orig->npix_x; |
357 | rtex->surface.level[level].npix_y = orig->npix_y; |
372 | rtex->surface.level[level].npix_y = orig->npix_y; |
- | 373 | rtex->mipmap_shift = 0; |
|
358 | } |
374 | } |
Line 359... | Line 375... | ||
359 | 375 | ||
360 | static void r600_resource_copy_region(struct pipe_context *ctx, |
376 | static void r600_resource_copy_region(struct pipe_context *ctx, |
361 | struct pipe_resource *dst, |
377 | struct pipe_resource *dst, |