summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-10 21:29:06 +0200
committerMarek Olšák <[email protected]>2012-04-24 01:39:21 +0200
commita52b3338c6e51421e3836ae210cd98d9c1ec337b (patch)
tree0b9d312f88760bbdc91bdd3e9d48195bfde6dce0 /src/gallium/drivers/r300
parent7d36478d888accd18d55cc76ba41af0ad7d3baf8 (diff)
u_vbuf: remove u_vbuf_resource
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_context.h2
-rw-r--r--src/gallium/drivers/r300/r300_emit.c6
-rw-r--r--src/gallium/drivers/r300/r300_fs.c2
-rw-r--r--src/gallium/drivers/r300/r300_render.c14
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c54
-rw-r--r--src/gallium/drivers/r300/r300_state.c4
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c6
-rw-r--r--src/gallium/drivers/r300/r300_texture.c16
-rw-r--r--src/gallium/drivers/r300/r300_texture_desc.c102
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c6
10 files changed, 105 insertions, 107 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 9367fc05ca2..29f27177077 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -383,7 +383,7 @@ struct r300_texture_desc {
struct r300_resource
{
- struct u_vbuf_resource b;
+ struct u_resource b;
/* Winsys buffer backing this resource. */
struct pb_buffer *buf;
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 467339f6a62..4c0daa6c56d 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -120,9 +120,9 @@ static void get_rc_constant_state(
case RC_STATE_R300_TEXSCALE_FACTOR:
tex = r300_resource(texstate->sampler_views[constant->u.State[1]]->base.texture);
/* Add a small number to the texture size to work around rounding errors in hw. */
- vec[0] = tex->b.b.b.width0 / (tex->tex.width0 + 0.001f);
- vec[1] = tex->b.b.b.height0 / (tex->tex.height0 + 0.001f);
- vec[2] = tex->b.b.b.depth0 / (tex->tex.depth0 + 0.001f);
+ vec[0] = tex->b.b.width0 / (tex->tex.width0 + 0.001f);
+ vec[1] = tex->b.b.height0 / (tex->tex.height0 + 0.001f);
+ vec[2] = tex->b.b.depth0 / (tex->tex.depth0 + 0.001f);
vec[3] = 1;
break;
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index 051b29217ad..8a492d2b40d 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -212,7 +212,7 @@ static void get_external_state(
state->unit[i].wrap_mode = RC_WRAP_NONE;
}
- if (t->b.b.b.target == PIPE_TEXTURE_3D)
+ if (t->b.b.target == PIPE_TEXTURE_3D)
state->unit[i].clamp_and_scale_before_fetch = TRUE;
}
}
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index c0f5687d80a..d5ba4fab499 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -529,7 +529,7 @@ static void r300_draw_elements_immediate(struct r300_context *r300,
switch (index_size) {
case 1:
- ptr1 = r300_resource(r300->index_buffer.buffer)->b.user_ptr;
+ ptr1 = r300->index_buffer.buffer->user_ptr;
ptr1 += info->start;
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (info->count << 16) |
@@ -553,7 +553,7 @@ static void r300_draw_elements_immediate(struct r300_context *r300,
break;
case 2:
- ptr2 = (uint16_t*)r300_resource(r300->index_buffer.buffer)->b.user_ptr;
+ ptr2 = (uint16_t*)r300->index_buffer.buffer->user_ptr;
ptr2 += info->start;
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (info->count << 16) |
@@ -572,7 +572,7 @@ static void r300_draw_elements_immediate(struct r300_context *r300,
break;
case 4:
- ptr4 = (uint32_t*)r300_resource(r300->index_buffer.buffer)->b.user_ptr;
+ ptr4 = (uint32_t*)r300->index_buffer.buffer->user_ptr;
ptr4 += info->start;
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (info->count << 16) |
@@ -614,7 +614,7 @@ static void r300_draw_elements(struct r300_context *r300,
/* Fallback for misaligned ushort indices. */
if (indexSize == 2 && (start & 1) &&
- !r300_resource(indexBuffer)->b.user_ptr) {
+ !indexBuffer->user_ptr) {
/* If we got here, then orgIndexBuffer == indexBuffer. */
uint16_t *ptr = r300->rws->buffer_map(r300_resource(orgIndexBuffer)->buf,
r300->cs,
@@ -632,10 +632,10 @@ static void r300_draw_elements(struct r300_context *r300,
}
r300->rws->buffer_unmap(r300_resource(orgIndexBuffer)->buf);
} else {
- if (r300_resource(indexBuffer)->b.user_ptr)
+ if (indexBuffer->user_ptr)
r300_upload_index_buffer(r300, &indexBuffer, indexSize,
&start, count,
- r300_resource(indexBuffer)->b.user_ptr);
+ indexBuffer->user_ptr);
}
/* 19 dwords for emit_draw_elements. Give up if the function fails. */
@@ -775,7 +775,7 @@ static void r300_draw_vbo(struct pipe_context* pipe,
if (info.instance_count <= 1) {
if (info.count <= 8 &&
- r300_resource(r300->index_buffer.buffer)->b.user_ptr) {
+ r300->index_buffer.buffer->user_ptr) {
r300_draw_elements_immediate(r300, &info);
} else {
r300_draw_elements(r300, &info, -1);
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index fba17a27720..c92b83146c0 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -108,8 +108,8 @@ r300_buffer_transfer_map( struct pipe_context *pipe,
uint8_t *map;
enum pipe_transfer_usage usage;
- if (rbuf->b.user_ptr)
- return (uint8_t *) rbuf->b.user_ptr + transfer->box.x;
+ if (rbuf->b.b.user_ptr)
+ return rbuf->b.b.user_ptr + transfer->box.x;
if (rbuf->constant_buffer)
return (uint8_t *) rbuf->constant_buffer + transfer->box.x;
@@ -158,7 +158,7 @@ static void r300_buffer_transfer_inline_write(struct pipe_context *pipe,
memcpy(rbuf->constant_buffer + box->x, data, box->width);
return;
}
- assert(rbuf->b.user_ptr == NULL);
+ assert(rbuf->b.b.user_ptr == NULL);
map = rws->buffer_map(rbuf->buf, r300->cs,
PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
@@ -189,12 +189,11 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
rbuf = util_slab_alloc(&r300screen->pool_buffers);
- rbuf->b.b.b = *templ;
- rbuf->b.b.vtbl = &r300_buffer_vtbl;
- pipe_reference_init(&rbuf->b.b.b.reference, 1);
- rbuf->b.b.b.screen = screen;
- rbuf->b.b.b.user_ptr = NULL;
- rbuf->b.user_ptr = NULL;
+ rbuf->b.b = *templ;
+ rbuf->b.vtbl = &r300_buffer_vtbl;
+ pipe_reference_init(&rbuf->b.b.reference, 1);
+ rbuf->b.b.screen = screen;
+ rbuf->b.b.user_ptr = NULL;
rbuf->domain = RADEON_DOMAIN_GTT;
rbuf->buf = NULL;
rbuf->constant_buffer = NULL;
@@ -202,13 +201,13 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
/* Alloc constant buffers in RAM. */
if (templ->bind & PIPE_BIND_CONSTANT_BUFFER) {
rbuf->constant_buffer = MALLOC(templ->width0);
- return &rbuf->b.b.b;
+ return &rbuf->b.b;
}
rbuf->buf =
r300screen->rws->buffer_create(r300screen->rws,
- rbuf->b.b.b.width0, alignment,
- rbuf->b.b.b.bind, rbuf->domain);
+ rbuf->b.b.width0, alignment,
+ rbuf->b.b.bind, rbuf->domain);
if (!rbuf->buf) {
util_slab_free(&r300screen->pool_buffers, rbuf);
return NULL;
@@ -217,7 +216,7 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
rbuf->cs_buf =
r300screen->rws->buffer_get_cs_handle(rbuf->buf);
- return &rbuf->b.b.b;
+ return &rbuf->b.b;
}
struct pipe_resource *r300_user_buffer_create(struct pipe_screen *screen,
@@ -229,22 +228,21 @@ struct pipe_resource *r300_user_buffer_create(struct pipe_screen *screen,
rbuf = util_slab_alloc(&r300screen->pool_buffers);
- pipe_reference_init(&rbuf->b.b.b.reference, 1);
- rbuf->b.b.b.screen = screen;
- rbuf->b.b.b.target = PIPE_BUFFER;
- rbuf->b.b.b.format = PIPE_FORMAT_R8_UNORM;
- rbuf->b.b.b.usage = PIPE_USAGE_IMMUTABLE;
- rbuf->b.b.b.bind = bind;
- rbuf->b.b.b.width0 = ~0;
- rbuf->b.b.b.height0 = 1;
- rbuf->b.b.b.depth0 = 1;
- rbuf->b.b.b.array_size = 1;
- rbuf->b.b.b.flags = 0;
- rbuf->b.b.b.user_ptr = ptr;
- rbuf->b.b.vtbl = &r300_buffer_vtbl;
- rbuf->b.user_ptr = ptr;
+ pipe_reference_init(&rbuf->b.b.reference, 1);
+ rbuf->b.b.screen = screen;
+ rbuf->b.b.target = PIPE_BUFFER;
+ rbuf->b.b.format = PIPE_FORMAT_R8_UNORM;
+ rbuf->b.b.usage = PIPE_USAGE_IMMUTABLE;
+ rbuf->b.b.bind = bind;
+ rbuf->b.b.width0 = ~0;
+ rbuf->b.b.height0 = 1;
+ rbuf->b.b.depth0 = 1;
+ rbuf->b.b.array_size = 1;
+ rbuf->b.b.flags = 0;
+ rbuf->b.b.user_ptr = ptr;
+ rbuf->b.vtbl = &r300_buffer_vtbl;
rbuf->domain = RADEON_DOMAIN_GTT;
rbuf->buf = NULL;
rbuf->constant_buffer = NULL;
- return &rbuf->b.b.b;
+ return &rbuf->b.b;
}
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index a5bc662f5fd..337008be47e 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1840,8 +1840,8 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
if (buf == NULL || buf->width0 == 0)
return;
- if (rbuf->b.user_ptr)
- mapped = (uint32_t*)rbuf->b.user_ptr;
+ if (rbuf->b.b.user_ptr)
+ mapped = (uint32_t*)rbuf->b.b.user_ptr;
else if (rbuf->constant_buffer)
mapped = (uint32_t*)rbuf->constant_buffer;
else
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 2dabf18d5e8..940179c6e9d 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -769,7 +769,7 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
base_level = view->base.u.tex.first_level;
min_level = sampler->min_lod;
level_count = MIN3(sampler->max_lod,
- tex->b.b.b.last_level - base_level,
+ tex->b.b.last_level - base_level,
view->base.u.tex.last_level - base_level);
if (base_level + min_level) {
@@ -832,14 +832,14 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
}
/* to emulate 1D textures through 2D ones correctly */
- if (tex->b.b.b.target == PIPE_TEXTURE_1D) {
+ if (tex->b.b.target == PIPE_TEXTURE_1D) {
texstate->filter0 &= ~R300_TX_WRAP_T_MASK;
texstate->filter0 |= R300_TX_WRAP_T(R300_TX_CLAMP_TO_EDGE);
}
/* The hardware doesn't like CLAMP and CLAMP_TO_BORDER
* for the 3rd coordinate if the texture isn't 3D. */
- if (tex->b.b.b.target != PIPE_TEXTURE_3D) {
+ if (tex->b.b.target != PIPE_TEXTURE_3D) {
texstate->filter0 &= ~R300_TX_WRAP_R_MASK;
}
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 75749e78b2d..8c5ee058b9e 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -728,7 +728,7 @@ void r300_texture_setup_format_state(struct r300_screen *screen,
unsigned height0_override,
struct r300_texture_format_state *out)
{
- struct pipe_resource *pt = &tex->b.b.b;
+ struct pipe_resource *pt = &tex->b.b;
struct r300_texture_desc *desc = &tex->tex;
boolean is_r500 = screen->caps.is_r500;
unsigned width, height, depth;
@@ -886,12 +886,12 @@ r300_texture_create_object(struct r300_screen *rscreen,
if (base->nr_samples > 1)
return NULL;
- pipe_reference_init(&tex->b.b.b.reference, 1);
- tex->b.b.b.screen = &rscreen->screen;
- tex->b.b.b.usage = base->usage;
- tex->b.b.b.bind = base->bind;
- tex->b.b.b.flags = base->flags;
- tex->b.b.vtbl = &r300_texture_vtbl;
+ pipe_reference_init(&tex->b.b.reference, 1);
+ tex->b.b.screen = &rscreen->screen;
+ tex->b.b.usage = base->usage;
+ tex->b.b.bind = base->bind;
+ tex->b.b.flags = base->flags;
+ tex->b.vtbl = &r300_texture_vtbl;
tex->tex.microtile = microtile;
tex->tex.macrotile[0] = macrotile;
tex->tex.stride_in_bytes_override = stride_in_bytes_override;
@@ -1033,7 +1033,7 @@ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,
/* Height must be aligned to the size of a tile. */
tile_height = r300_get_pixel_alignment(surface->base.format,
- tex->b.b.b.nr_samples,
+ tex->b.b.nr_samples,
tex->tex.microtile,
tex->tex.macrotile[level],
DIM_HEIGHT, 0);
diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
index c250bf15604..04d439bcc1f 100644
--- a/src/gallium/drivers/r300/r300_texture_desc.c
+++ b/src/gallium/drivers/r300/r300_texture_desc.c
@@ -95,7 +95,7 @@ static boolean r300_texture_macro_switch(struct r300_resource *tex,
{
unsigned tile, texdim;
- tile = r300_get_pixel_alignment(tex->b.b.b.format, tex->b.b.b.nr_samples,
+ tile = r300_get_pixel_alignment(tex->b.b.format, tex->b.b.nr_samples,
tex->tex.microtile, RADEON_LAYOUT_TILED, dim, 0);
if (dim == DIM_WIDTH) {
texdim = u_minify(tex->tex.width0, level);
@@ -128,27 +128,27 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
return tex->tex.stride_in_bytes_override;
/* Check the level. */
- if (level > tex->b.b.b.last_level) {
+ if (level > tex->b.b.last_level) {
SCREEN_DBG(screen, DBG_TEX, "%s: level (%u) > last_level (%u)\n",
- __FUNCTION__, level, tex->b.b.b.last_level);
+ __FUNCTION__, level, tex->b.b.last_level);
return 0;
}
width = u_minify(tex->tex.width0, level);
- if (util_format_is_plain(tex->b.b.b.format)) {
- tile_width = r300_get_pixel_alignment(tex->b.b.b.format,
- tex->b.b.b.nr_samples,
+ if (util_format_is_plain(tex->b.b.format)) {
+ tile_width = r300_get_pixel_alignment(tex->b.b.format,
+ tex->b.b.nr_samples,
tex->tex.microtile,
tex->tex.macrotile[level],
DIM_WIDTH, is_rs690);
width = align(width, tile_width);
- stride = util_format_get_stride(tex->b.b.b.format, width);
+ stride = util_format_get_stride(tex->b.b.format, width);
/* The alignment to 32 bytes is sort of implied by the layout... */
return stride;
} else {
- return align(util_format_get_stride(tex->b.b.b.format, width), is_rs690 ? 64 : 32);
+ return align(util_format_get_stride(tex->b.b.format, width), is_rs690 ? 64 : 32);
}
}
@@ -161,16 +161,16 @@ static unsigned r300_texture_get_nblocksy(struct r300_resource *tex,
height = u_minify(tex->tex.height0, level);
/* Mipmapped and 3D textures must have their height aligned to POT. */
- if ((tex->b.b.b.target != PIPE_TEXTURE_1D &&
- tex->b.b.b.target != PIPE_TEXTURE_2D &&
- tex->b.b.b.target != PIPE_TEXTURE_RECT) ||
- tex->b.b.b.last_level != 0) {
+ if ((tex->b.b.target != PIPE_TEXTURE_1D &&
+ tex->b.b.target != PIPE_TEXTURE_2D &&
+ tex->b.b.target != PIPE_TEXTURE_RECT) ||
+ tex->b.b.last_level != 0) {
height = util_next_power_of_two(height);
}
- if (util_format_is_plain(tex->b.b.b.format)) {
- tile_height = r300_get_pixel_alignment(tex->b.b.b.format,
- tex->b.b.b.nr_samples,
+ if (util_format_is_plain(tex->b.b.format)) {
+ tile_height = r300_get_pixel_alignment(tex->b.b.format,
+ tex->b.b.nr_samples,
tex->tex.microtile,
tex->tex.macrotile[level],
DIM_HEIGHT, 0);
@@ -187,10 +187,10 @@ static unsigned r300_texture_get_nblocksy(struct r300_resource *tex,
/* Align the height so that there is an even number of macrotiles.
* Do so for 3 or more macrotiles in the Y direction. */
- if (level == 0 && tex->b.b.b.last_level == 0 &&
- (tex->b.b.b.target == PIPE_TEXTURE_1D ||
- tex->b.b.b.target == PIPE_TEXTURE_2D ||
- tex->b.b.b.target == PIPE_TEXTURE_RECT) &&
+ if (level == 0 && tex->b.b.last_level == 0 &&
+ (tex->b.b.target == PIPE_TEXTURE_1D ||
+ tex->b.b.target == PIPE_TEXTURE_2D ||
+ tex->b.b.target == PIPE_TEXTURE_RECT) &&
height >= tile_height * 3) {
height = align(height, tile_height * 2);
}
@@ -202,7 +202,7 @@ static unsigned r300_texture_get_nblocksy(struct r300_resource *tex,
}
}
- return util_format_get_nblocksy(tex->b.b.b.format, height);
+ return util_format_get_nblocksy(tex->b.b.format, height);
}
/* Get a width in pixels from a stride in bytes. */
@@ -217,7 +217,7 @@ static void r300_setup_miptree(struct r300_screen *screen,
struct r300_resource *tex,
boolean align_for_cbzb)
{
- struct pipe_resource *base = &tex->b.b.b;
+ struct pipe_resource *base = &tex->b.b;
unsigned stride, size, layer_size, nblocksy, i;
boolean rv350_mode = screen->caps.family >= CHIP_FAMILY_R350;
boolean aligned_for_cbzb;
@@ -274,15 +274,15 @@ static void r300_setup_miptree(struct r300_screen *screen,
static void r300_setup_flags(struct r300_resource *tex)
{
tex->tex.uses_stride_addressing =
- !util_is_power_of_two(tex->b.b.b.width0) ||
+ !util_is_power_of_two(tex->b.b.width0) ||
(tex->tex.stride_in_bytes_override &&
- r300_stride_to_width(tex->b.b.b.format,
- tex->tex.stride_in_bytes_override) != tex->b.b.b.width0);
+ r300_stride_to_width(tex->b.b.format,
+ tex->tex.stride_in_bytes_override) != tex->b.b.width0);
tex->tex.is_npot =
tex->tex.uses_stride_addressing ||
- !util_is_power_of_two(tex->b.b.b.height0) ||
- !util_is_power_of_two(tex->b.b.b.depth0);
+ !util_is_power_of_two(tex->b.b.height0) ||
+ !util_is_power_of_two(tex->b.b.depth0);
}
static void r300_setup_cbzb_flags(struct r300_screen *rscreen,
@@ -291,20 +291,20 @@ static void r300_setup_cbzb_flags(struct r300_screen *rscreen,
unsigned i, bpp;
boolean first_level_valid;
- bpp = util_format_get_blocksizebits(tex->b.b.b.format);
+ bpp = util_format_get_blocksizebits(tex->b.b.format);
/* 1) The texture must be point-sampled,
* 2) The depth must be 16 or 32 bits.
* 3) If the midpoint ZB offset is not aligned to 2048, it returns garbage
* with certain texture sizes. Macrotiling ensures the alignment. */
- first_level_valid = tex->b.b.b.nr_samples <= 1 &&
+ first_level_valid = tex->b.b.nr_samples <= 1 &&
(bpp == 16 || bpp == 32) &&
tex->tex.macrotile[0];
if (SCREEN_DBG_ON(rscreen, DBG_NO_CBZB))
first_level_valid = FALSE;
- for (i = 0; i <= tex->b.b.b.last_level; i++)
+ for (i = 0; i <= tex->b.b.last_level; i++)
tex->tex.cbzb_allowed[i] = first_level_valid && tex->tex.macrotile[i];
}
@@ -353,8 +353,8 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
static unsigned hiz_align_x[4] = {8, 32, 48, 32};
static unsigned hiz_align_y[4] = {8, 8, 8, 32};
- if (util_format_is_depth_or_stencil(tex->b.b.b.format) &&
- util_format_get_blocksizebits(tex->b.b.b.format) == 32 &&
+ if (util_format_is_depth_or_stencil(tex->b.b.format) &&
+ util_format_get_blocksizebits(tex->b.b.format) == 32 &&
tex->tex.microtile) {
unsigned i, pipes;
@@ -364,18 +364,18 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
pipes = screen->info.r300_num_gb_pipes;
}
- for (i = 0; i <= tex->b.b.b.last_level; i++) {
+ for (i = 0; i <= tex->b.b.last_level; i++) {
unsigned zcomp_numdw, zcompsize, hiz_numdw, stride, height;
- stride = r300_stride_to_width(tex->b.b.b.format,
+ stride = r300_stride_to_width(tex->b.b.format,
tex->tex.stride_in_bytes[i]);
stride = align(stride, 16);
- height = u_minify(tex->b.b.b.height0, i);
+ height = u_minify(tex->b.b.height0, i);
/* The 8x8 compression mode needs macrotiling. */
zcompsize = screen->caps.z_compress == R300_ZCOMP_8X8 &&
tex->tex.macrotile[i] &&
- tex->b.b.b.nr_samples <= 1 ? 8 : 4;
+ tex->b.b.nr_samples <= 1 ? 8 : 4;
/* Get the ZMASK buffer size in dwords. */
zcomp_numdw = r300_pixels_to_dwords(stride, height,
@@ -383,7 +383,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
zmask_blocks_y_per_dw[pipes-1] * zcompsize);
/* Check whether we have enough ZMASK memory. */
- if (util_format_get_blocksizebits(tex->b.b.b.format) == 32 &&
+ if (util_format_get_blocksizebits(tex->b.b.format) == 32 &&
zcomp_numdw <= screen->caps.zmask_ram * pipes) {
tex->tex.zmask_dwords[i] = zcomp_numdw;
tex->tex.zcomp8x8[i] = zcompsize == 8;
@@ -418,7 +418,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
static void r300_setup_tiling(struct r300_screen *screen,
struct r300_resource *tex)
{
- enum pipe_format format = tex->b.b.b.format;
+ enum pipe_format format = tex->b.b.format;
boolean rv350_mode = screen->caps.family >= CHIP_FAMILY_R350;
boolean is_zb = util_format_is_depth_or_stencil(format);
boolean dbg_no_tiling = SCREEN_DBG_ON(screen, DBG_NO_TILING);
@@ -431,7 +431,7 @@ static void r300_setup_tiling(struct r300_screen *screen,
}
/* If height == 1, disable microtiling except for zbuffer. */
- if (!is_zb && (tex->b.b.b.height0 == 1 || dbg_no_tiling)) {
+ if (!is_zb && (tex->b.b.height0 == 1 || dbg_no_tiling)) {
return;
}
@@ -468,24 +468,24 @@ static void r300_tex_print_info(struct r300_resource *tex,
func,
tex->tex.macrotile[0] ? "YES" : " NO",
tex->tex.microtile ? "YES" : " NO",
- r300_stride_to_width(tex->b.b.b.format, tex->tex.stride_in_bytes[0]),
- tex->b.b.b.width0, tex->b.b.b.height0, tex->b.b.b.depth0,
- tex->b.b.b.last_level, tex->tex.size_in_bytes,
- util_format_short_name(tex->b.b.b.format));
+ r300_stride_to_width(tex->b.b.format, tex->tex.stride_in_bytes[0]),
+ tex->b.b.width0, tex->b.b.height0, tex->b.b.depth0,
+ tex->b.b.last_level, tex->tex.size_in_bytes,
+ util_format_short_name(tex->b.b.format));
}
void r300_texture_desc_init(struct r300_screen *rscreen,
struct r300_resource *tex,
const struct pipe_resource *base)
{
- tex->b.b.b.target = base->target;
- tex->b.b.b.format = base->format;
- tex->b.b.b.width0 = base->width0;
- tex->b.b.b.height0 = base->height0;
- tex->b.b.b.depth0 = base->depth0;
- tex->b.b.b.array_size = base->array_size;
- tex->b.b.b.last_level = base->last_level;
- tex->b.b.b.nr_samples = base->nr_samples;
+ tex->b.b.target = base->target;
+ tex->b.b.format = base->format;
+ tex->b.b.width0 = base->width0;
+ tex->b.b.height0 = base->height0;
+ tex->b.b.depth0 = base->depth0;
+ tex->b.b.array_size = base->array_size;
+ tex->b.b.last_level = base->last_level;
+ tex->b.b.nr_samples = base->nr_samples;
tex->tex.width0 = base->width0;
tex->tex.height0 = base->height0;
tex->tex.depth0 = base->depth0;
@@ -538,7 +538,7 @@ unsigned r300_texture_get_offset(struct r300_resource *tex,
{
unsigned offset = tex->tex.offset_in_bytes[level];
- switch (tex->b.b.b.target) {
+ switch (tex->b.b.target) {
case PIPE_TEXTURE_3D:
case PIPE_TEXTURE_CUBE:
return offset + layer * tex->tex.layer_size_in_bytes[level];
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index d440db8e305..44ff390ca0c 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -54,7 +54,7 @@ static void r300_copy_from_tiled_texture(struct pipe_context *ctx,
struct pipe_transfer *transfer = (struct pipe_transfer*)r300transfer;
struct pipe_resource *tex = transfer->resource;
- ctx->resource_copy_region(ctx, &r300transfer->linear_texture->b.b.b, 0,
+ ctx->resource_copy_region(ctx, &r300transfer->linear_texture->b.b, 0,
0, 0, 0,
tex, transfer->level, &transfer->box);
}
@@ -70,7 +70,7 @@ static void r300_copy_into_tiled_texture(struct pipe_context *ctx,
ctx->resource_copy_region(ctx, tex, transfer->level,
transfer->box.x, transfer->box.y, transfer->box.z,
- &r300transfer->linear_texture->b.b.b, 0, &src_box);
+ &r300transfer->linear_texture->b.b, 0, &src_box);
/* XXX remove this. */
r300_flush(ctx, 0, NULL);
@@ -230,7 +230,7 @@ void* r300_texture_transfer_map(struct pipe_context *ctx,
struct r300_transfer *r300transfer = r300_transfer(transfer);
struct r300_resource *tex = r300_resource(transfer->resource);
char *map;
- enum pipe_format format = tex->b.b.b.format;
+ enum pipe_format format = tex->b.b.format;
if (r300transfer->linear_texture) {
/* The detiled texture is of the same size as the region being mapped