static void r300_texture_3d_fix_mipmapping(struct r300_screen *screen,
struct r300_texture *tex)
{
- /* The kernels <= 2.6.34-rc3 compute the size of mipmapped 3D textures
+ /* The kernels <= 2.6.34-rc4 compute the size of mipmapped 3D textures
* incorrectly. This is a workaround to prevent CS from being rejected. */
unsigned i, size;
- if (screen->rws->get_value(screen->rws, R300_VID_TEX3D_MIP_BUG) &&
+ if (screen->rws->get_value(screen->rws, R300_VID_DRM_2_3_0) &&
tex->b.b.target == PIPE_TEXTURE_3D &&
tex->b.b.last_level > 0) {
size = 0;
{
struct pipe_resource* base = &tex->b.b;
unsigned stride, size, layer_size, nblocksy, i;
- boolean rv350_mode = screen->caps.family >= CHIP_FAMILY_RV350;
+ boolean rv350_mode = screen->caps.is_rv350;
SCREEN_DBG(screen, DBG_TEX, "r300: Making miptree for texture, format %s\n",
util_format_name(base->format));
{
struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys;
enum pipe_format format = tex->b.b.format;
- boolean rv350_mode = r300_screen(screen)->caps.family >= CHIP_FAMILY_RV350;
+ boolean rv350_mode = r300_screen(screen)->caps.is_rv350;
+ boolean is_zb = util_format_is_depth_or_stencil(format);
+ boolean dbg_no_tiling = SCREEN_DBG_ON(r300_screen(screen), DBG_NO_TILING);
if (!r300_format_is_plain(format)) {
return;
}
- if (tex->b.b.width0 == 1 ||
- tex->b.b.height0 == 1) {
+ /* If height == 1, disable microtiling except for zbuffer. */
+ if (!is_zb && (tex->b.b.height0 == 1 || dbg_no_tiling)) {
return;
}
break;
}
+ if (dbg_no_tiling) {
+ return;
+ }
+
/* Set macrotiling. */
if (r300_texture_macro_switch(tex, 0, rv350_mode, TILE_WIDTH) &&
r300_texture_macro_switch(tex, 0, rv350_mode, TILE_HEIGHT)) {
struct r300_context *r300 = r300_context(context);
struct r300_texture *rtex = (struct r300_texture *)texture;
- if (r300->rws->is_buffer_referenced(r300->rws, rtex->buffer))
+ if (r300->rws->is_buffer_referenced(r300->rws, rtex->buffer, R300_REF_CS))
return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
return PIPE_UNREFERENCED;
FREE(tex);
}
-
-
-
-static boolean
- r300_texture_get_handle(struct pipe_screen* screen,
- struct pipe_resource *texture,
- struct winsys_handle *whandle)
+static boolean r300_texture_get_handle(struct pipe_screen* screen,
+ struct pipe_resource *texture,
+ struct winsys_handle *whandle)
{
struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys;
struct r300_texture* tex = (struct r300_texture*)texture;
return TRUE;
}
-
-
struct u_resource_vtbl r300_texture_vtbl =
{
r300_texture_get_handle, /* get_handle */
u_default_transfer_inline_write /* transfer_inline_write */
};
-
-
/* Create a new texture. */
struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
const struct pipe_resource* base)
return (struct pipe_resource*)tex;
}
-
-
/* Not required to implement u_resource_vtbl, consider moving to another file:
*/
struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
}
return (struct pipe_resource*)tex;
}
-