mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 09:00:10 +01:00
r600g: rename r600_resource_texture to r600_texture
This commit is contained in:
parent
952c905767
commit
951ac46a6a
9 changed files with 48 additions and 48 deletions
|
|
@ -41,12 +41,12 @@
|
||||||
#include "compute_memory_pool.h"
|
#include "compute_memory_pool.h"
|
||||||
#include "evergreen_compute_internal.h"
|
#include "evergreen_compute_internal.h"
|
||||||
|
|
||||||
static struct r600_resource_texture * create_pool_texture(struct r600_screen * screen,
|
static struct r600_texture * create_pool_texture(struct r600_screen * screen,
|
||||||
unsigned size_in_dw)
|
unsigned size_in_dw)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct pipe_resource templ;
|
struct pipe_resource templ;
|
||||||
struct r600_resource_texture * tex;
|
struct r600_texture * tex;
|
||||||
|
|
||||||
if (size_in_dw == 0) {
|
if (size_in_dw == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -62,7 +62,7 @@ static struct r600_resource_texture * create_pool_texture(struct r600_screen * s
|
||||||
templ.depth0 = 1;
|
templ.depth0 = 1;
|
||||||
templ.array_size = 1;
|
templ.array_size = 1;
|
||||||
|
|
||||||
tex = (struct r600_resource_texture *)r600_texture_create(
|
tex = (struct r600_texture *)r600_texture_create(
|
||||||
&screen->screen, &templ);
|
&screen->screen, &templ);
|
||||||
/* XXX: Propagate this error */
|
/* XXX: Propagate this error */
|
||||||
assert(tex && "Out of memory");
|
assert(tex && "Out of memory");
|
||||||
|
|
|
||||||
|
|
@ -497,8 +497,8 @@ void evergreen_set_tex_resource(
|
||||||
{
|
{
|
||||||
struct evergreen_compute_resource* res =
|
struct evergreen_compute_resource* res =
|
||||||
get_empty_res(pipe, COMPUTE_RESOURCE_TEX, id);
|
get_empty_res(pipe, COMPUTE_RESOURCE_TEX, id);
|
||||||
struct r600_resource_texture *tmp =
|
struct r600_texture *tmp =
|
||||||
(struct r600_resource_texture*)view->base.texture;
|
(struct r600_texture*)view->base.texture;
|
||||||
|
|
||||||
unsigned format, endian;
|
unsigned format, endian;
|
||||||
uint32_t word4 = 0, yuv_format = 0, pitch = 0;
|
uint32_t word4 = 0, yuv_format = 0, pitch = 0;
|
||||||
|
|
|
||||||
|
|
@ -993,7 +993,7 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
|
||||||
{
|
{
|
||||||
struct r600_screen *rscreen = (struct r600_screen*)ctx->screen;
|
struct r600_screen *rscreen = (struct r600_screen*)ctx->screen;
|
||||||
struct r600_pipe_sampler_view *view = CALLOC_STRUCT(r600_pipe_sampler_view);
|
struct r600_pipe_sampler_view *view = CALLOC_STRUCT(r600_pipe_sampler_view);
|
||||||
struct r600_resource_texture *tmp = (struct r600_resource_texture*)texture;
|
struct r600_texture *tmp = (struct r600_texture*)texture;
|
||||||
unsigned format, endian;
|
unsigned format, endian;
|
||||||
uint32_t word4 = 0, yuv_format = 0, pitch = 0;
|
uint32_t word4 = 0, yuv_format = 0, pitch = 0;
|
||||||
unsigned char swizzle[4], array_mode = 0, tile_type = 0;
|
unsigned char swizzle[4], array_mode = 0, tile_type = 0;
|
||||||
|
|
@ -1244,7 +1244,7 @@ void evergreen_init_color_surface(struct r600_context *rctx,
|
||||||
struct r600_surface *surf)
|
struct r600_surface *surf)
|
||||||
{
|
{
|
||||||
struct r600_screen *rscreen = rctx->screen;
|
struct r600_screen *rscreen = rctx->screen;
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)surf->base.texture;
|
struct r600_texture *rtex = (struct r600_texture*)surf->base.texture;
|
||||||
struct pipe_resource *pipe_tex = surf->base.texture;
|
struct pipe_resource *pipe_tex = surf->base.texture;
|
||||||
unsigned level = surf->base.u.tex.level;
|
unsigned level = surf->base.u.tex.level;
|
||||||
unsigned pitch, slice;
|
unsigned pitch, slice;
|
||||||
|
|
@ -1418,7 +1418,7 @@ static void evergreen_init_depth_surface(struct r600_context *rctx,
|
||||||
{
|
{
|
||||||
struct r600_screen *rscreen = rctx->screen;
|
struct r600_screen *rscreen = rctx->screen;
|
||||||
struct pipe_screen *screen = &rscreen->screen;
|
struct pipe_screen *screen = &rscreen->screen;
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)surf->base.texture;
|
struct r600_texture *rtex = (struct r600_texture*)surf->base.texture;
|
||||||
uint64_t offset;
|
uint64_t offset;
|
||||||
unsigned level, pitch, slice, format, array_mode;
|
unsigned level, pitch, slice, format, array_mode;
|
||||||
unsigned macro_aspect, tile_split, bankh, bankw, nbanks;
|
unsigned macro_aspect, tile_split, bankh, bankw, nbanks;
|
||||||
|
|
@ -1677,7 +1677,7 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
|
||||||
surf->cb_color_attrib, res, RADEON_USAGE_READWRITE);
|
surf->cb_color_attrib, res, RADEON_USAGE_READWRITE);
|
||||||
}
|
}
|
||||||
/* set CB_COLOR1_INFO for possible dual-src blending */
|
/* set CB_COLOR1_INFO for possible dual-src blending */
|
||||||
if (i == 1 && !((struct r600_resource_texture*)res)->is_rat) {
|
if (i == 1 && !((struct r600_texture*)res)->is_rat) {
|
||||||
r600_pipe_state_add_reg_bo(rstate, R_028C70_CB_COLOR0_INFO + 1 * 0x3C,
|
r600_pipe_state_add_reg_bo(rstate, R_028C70_CB_COLOR0_INFO + 1 * 0x3C,
|
||||||
surf->cb_color_info, res, RADEON_USAGE_READWRITE);
|
surf->cb_color_info, res, RADEON_USAGE_READWRITE);
|
||||||
i++;
|
i++;
|
||||||
|
|
|
||||||
|
|
@ -128,15 +128,15 @@ static unsigned u_max_sample(struct pipe_resource *r)
|
||||||
}
|
}
|
||||||
|
|
||||||
void r600_blit_uncompress_depth(struct pipe_context *ctx,
|
void r600_blit_uncompress_depth(struct pipe_context *ctx,
|
||||||
struct r600_resource_texture *texture,
|
struct r600_texture *texture,
|
||||||
struct r600_resource_texture *staging,
|
struct r600_texture *staging,
|
||||||
unsigned first_level, unsigned last_level,
|
unsigned first_level, unsigned last_level,
|
||||||
unsigned first_layer, unsigned last_layer,
|
unsigned first_layer, unsigned last_layer,
|
||||||
unsigned first_sample, unsigned last_sample)
|
unsigned first_sample, unsigned last_sample)
|
||||||
{
|
{
|
||||||
struct r600_context *rctx = (struct r600_context *)ctx;
|
struct r600_context *rctx = (struct r600_context *)ctx;
|
||||||
unsigned layer, level, sample, checked_last_layer, max_layer, max_sample;
|
unsigned layer, level, sample, checked_last_layer, max_layer, max_sample;
|
||||||
struct r600_resource_texture *flushed_depth_texture = staging ?
|
struct r600_texture *flushed_depth_texture = staging ?
|
||||||
staging : texture->flushed_depth_texture;
|
staging : texture->flushed_depth_texture;
|
||||||
const struct util_format_description *desc =
|
const struct util_format_description *desc =
|
||||||
util_format_description(texture->resource.b.b.format);
|
util_format_description(texture->resource.b.b.format);
|
||||||
|
|
@ -226,14 +226,14 @@ void r600_flush_depth_textures(struct r600_context *rctx,
|
||||||
|
|
||||||
while (depth_texture_mask) {
|
while (depth_texture_mask) {
|
||||||
struct pipe_sampler_view *view;
|
struct pipe_sampler_view *view;
|
||||||
struct r600_resource_texture *tex;
|
struct r600_texture *tex;
|
||||||
|
|
||||||
i = u_bit_scan(&depth_texture_mask);
|
i = u_bit_scan(&depth_texture_mask);
|
||||||
|
|
||||||
view = &textures->views[i]->base;
|
view = &textures->views[i]->base;
|
||||||
assert(view);
|
assert(view);
|
||||||
|
|
||||||
tex = (struct r600_resource_texture *)view->texture;
|
tex = (struct r600_texture *)view->texture;
|
||||||
assert(tex->is_depth && !tex->is_flushing_texture);
|
assert(tex->is_depth && !tex->is_flushing_texture);
|
||||||
|
|
||||||
r600_blit_uncompress_depth(&rctx->context, tex, NULL,
|
r600_blit_uncompress_depth(&rctx->context, tex, NULL,
|
||||||
|
|
@ -247,7 +247,7 @@ static void r600_copy_first_sample(struct pipe_context *ctx,
|
||||||
const struct pipe_resolve_info *info)
|
const struct pipe_resolve_info *info)
|
||||||
{
|
{
|
||||||
struct r600_context *rctx = (struct r600_context *)ctx;
|
struct r600_context *rctx = (struct r600_context *)ctx;
|
||||||
struct r600_resource_texture *rsrc = (struct r600_resource_texture*)info->src.res;
|
struct r600_texture *rsrc = (struct r600_texture*)info->src.res;
|
||||||
struct pipe_surface *dst_view, dst_templ;
|
struct pipe_surface *dst_view, dst_templ;
|
||||||
struct pipe_sampler_view src_templ, *src_view;
|
struct pipe_sampler_view src_templ, *src_view;
|
||||||
struct pipe_box box;
|
struct pipe_box box;
|
||||||
|
|
@ -471,7 +471,7 @@ static void r600_compressed_to_blittable(struct pipe_resource *tex,
|
||||||
unsigned level,
|
unsigned level,
|
||||||
struct texture_orig_info *orig)
|
struct texture_orig_info *orig)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)tex;
|
struct r600_texture *rtex = (struct r600_texture*)tex;
|
||||||
unsigned pixsize = util_format_get_blocksize(rtex->resource.b.b.format);
|
unsigned pixsize = util_format_get_blocksize(rtex->resource.b.b.format);
|
||||||
int new_format;
|
int new_format;
|
||||||
int new_height, new_width;
|
int new_height, new_width;
|
||||||
|
|
@ -506,7 +506,7 @@ static void r600_change_format(struct pipe_resource *tex,
|
||||||
struct texture_orig_info *orig,
|
struct texture_orig_info *orig,
|
||||||
enum pipe_format format)
|
enum pipe_format format)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)tex;
|
struct r600_texture *rtex = (struct r600_texture*)tex;
|
||||||
|
|
||||||
orig->format = tex->format;
|
orig->format = tex->format;
|
||||||
orig->width0 = tex->width0;
|
orig->width0 = tex->width0;
|
||||||
|
|
@ -523,7 +523,7 @@ static void r600_reset_blittable_to_orig(struct pipe_resource *tex,
|
||||||
unsigned level,
|
unsigned level,
|
||||||
struct texture_orig_info *orig)
|
struct texture_orig_info *orig)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)tex;
|
struct r600_texture *rtex = (struct r600_texture*)tex;
|
||||||
|
|
||||||
tex->format = orig->format;
|
tex->format = orig->format;
|
||||||
tex->width0 = orig->width0;
|
tex->width0 = orig->width0;
|
||||||
|
|
@ -543,7 +543,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
|
||||||
const struct pipe_box *src_box)
|
const struct pipe_box *src_box)
|
||||||
{
|
{
|
||||||
struct r600_context *rctx = (struct r600_context *)ctx;
|
struct r600_context *rctx = (struct r600_context *)ctx;
|
||||||
struct r600_resource_texture *rsrc = (struct r600_resource_texture*)src;
|
struct r600_texture *rsrc = (struct r600_texture*)src;
|
||||||
struct texture_orig_info orig_info[2];
|
struct texture_orig_info orig_info[2];
|
||||||
struct pipe_box sbox;
|
struct pipe_box sbox;
|
||||||
const struct pipe_box *psbox = src_box;
|
const struct pipe_box *psbox = src_box;
|
||||||
|
|
|
||||||
|
|
@ -484,8 +484,8 @@ void r600_copy_buffer(struct pipe_context *ctx, struct
|
||||||
struct pipe_resource *src, const struct pipe_box *src_box);
|
struct pipe_resource *src, const struct pipe_box *src_box);
|
||||||
void r600_init_blit_functions(struct r600_context *rctx);
|
void r600_init_blit_functions(struct r600_context *rctx);
|
||||||
void r600_blit_uncompress_depth(struct pipe_context *ctx,
|
void r600_blit_uncompress_depth(struct pipe_context *ctx,
|
||||||
struct r600_resource_texture *texture,
|
struct r600_texture *texture,
|
||||||
struct r600_resource_texture *staging,
|
struct r600_texture *staging,
|
||||||
unsigned first_level, unsigned last_level,
|
unsigned first_level, unsigned last_level,
|
||||||
unsigned first_layer, unsigned last_layer,
|
unsigned first_layer, unsigned last_layer,
|
||||||
unsigned first_sample, unsigned last_sample);
|
unsigned first_sample, unsigned last_sample);
|
||||||
|
|
@ -546,7 +546,7 @@ void r600_init_surface_functions(struct r600_context *r600);
|
||||||
uint32_t r600_translate_texformat(struct pipe_screen *screen, enum pipe_format format,
|
uint32_t r600_translate_texformat(struct pipe_screen *screen, enum pipe_format format,
|
||||||
const unsigned char *swizzle_view,
|
const unsigned char *swizzle_view,
|
||||||
uint32_t *word4_p, uint32_t *yuv_format_p);
|
uint32_t *word4_p, uint32_t *yuv_format_p);
|
||||||
unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
|
unsigned r600_texture_get_offset(struct r600_texture *rtex,
|
||||||
unsigned level, unsigned layer);
|
unsigned level, unsigned layer);
|
||||||
|
|
||||||
/* r600_translate.c */
|
/* r600_translate.c */
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ struct r600_resource_global {
|
||||||
struct compute_memory_item *chunk;
|
struct compute_memory_item *chunk;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct r600_resource_texture {
|
struct r600_texture {
|
||||||
struct r600_resource resource;
|
struct r600_resource resource;
|
||||||
|
|
||||||
unsigned array_mode[PIPE_MAX_TEXTURE_LEVELS];
|
unsigned array_mode[PIPE_MAX_TEXTURE_LEVELS];
|
||||||
|
|
@ -52,7 +52,7 @@ struct r600_resource_texture {
|
||||||
bool is_depth;
|
bool is_depth;
|
||||||
bool is_rat;
|
bool is_rat;
|
||||||
unsigned dirty_db_mask; /* each bit says if that miplevel is dirty */
|
unsigned dirty_db_mask; /* each bit says if that miplevel is dirty */
|
||||||
struct r600_resource_texture *flushed_depth_texture;
|
struct r600_texture *flushed_depth_texture;
|
||||||
boolean is_flushing_texture;
|
boolean is_flushing_texture;
|
||||||
struct radeon_surface surface;
|
struct radeon_surface surface;
|
||||||
};
|
};
|
||||||
|
|
@ -109,7 +109,7 @@ static INLINE struct r600_resource *r600_resource(struct pipe_resource *r)
|
||||||
|
|
||||||
bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
|
bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
|
||||||
struct pipe_resource *texture,
|
struct pipe_resource *texture,
|
||||||
struct r600_resource_texture **staging);
|
struct r600_texture **staging);
|
||||||
|
|
||||||
/* r600_texture.c texture transfer functions. */
|
/* r600_texture.c texture transfer functions. */
|
||||||
struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
||||||
|
|
|
||||||
|
|
@ -979,7 +979,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
|
||||||
const struct pipe_sampler_view *state)
|
const struct pipe_sampler_view *state)
|
||||||
{
|
{
|
||||||
struct r600_pipe_sampler_view *view = CALLOC_STRUCT(r600_pipe_sampler_view);
|
struct r600_pipe_sampler_view *view = CALLOC_STRUCT(r600_pipe_sampler_view);
|
||||||
struct r600_resource_texture *tmp = (struct r600_resource_texture*)texture;
|
struct r600_texture *tmp = (struct r600_texture*)texture;
|
||||||
unsigned format, endian;
|
unsigned format, endian;
|
||||||
uint32_t word4 = 0, yuv_format = 0, pitch = 0;
|
uint32_t word4 = 0, yuv_format = 0, pitch = 0;
|
||||||
unsigned char swizzle[4], array_mode = 0, tile_type = 0;
|
unsigned char swizzle[4], array_mode = 0, tile_type = 0;
|
||||||
|
|
@ -1197,7 +1197,7 @@ static void r600_set_viewport_state(struct pipe_context *ctx,
|
||||||
static void r600_init_color_surface(struct r600_context *rctx,
|
static void r600_init_color_surface(struct r600_context *rctx,
|
||||||
struct r600_surface *surf)
|
struct r600_surface *surf)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)surf->base.texture;
|
struct r600_texture *rtex = (struct r600_texture*)surf->base.texture;
|
||||||
unsigned level = surf->base.u.tex.level;
|
unsigned level = surf->base.u.tex.level;
|
||||||
unsigned pitch, slice;
|
unsigned pitch, slice;
|
||||||
unsigned color_info;
|
unsigned color_info;
|
||||||
|
|
@ -1345,7 +1345,7 @@ static void r600_init_color_surface(struct r600_context *rctx,
|
||||||
static void r600_init_depth_surface(struct r600_context *rctx,
|
static void r600_init_depth_surface(struct r600_context *rctx,
|
||||||
struct r600_surface *surf)
|
struct r600_surface *surf)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)surf->base.texture;
|
struct r600_texture *rtex = (struct r600_texture*)surf->base.texture;
|
||||||
unsigned level, pitch, slice, format, offset, array_mode;
|
unsigned level, pitch, slice, format, offset, array_mode;
|
||||||
|
|
||||||
level = surf->base.u.tex.level;
|
level = surf->base.u.tex.level;
|
||||||
|
|
|
||||||
|
|
@ -607,8 +607,8 @@ void r600_set_sampler_views(struct pipe_context *pipe,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rviews[i]) {
|
if (rviews[i]) {
|
||||||
struct r600_resource_texture *rtex =
|
struct r600_texture *rtex =
|
||||||
(struct r600_resource_texture*)rviews[i]->base.texture;
|
(struct r600_texture*)rviews[i]->base.texture;
|
||||||
|
|
||||||
if (rtex->is_depth && !rtex->is_flushing_texture) {
|
if (rtex->is_depth && !rtex->is_flushing_texture) {
|
||||||
dst->views.depth_texture_mask |= 1 << i;
|
dst->views.depth_texture_mask |= 1 << i;
|
||||||
|
|
@ -1237,7 +1237,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
|
||||||
/* Set the depth buffer as dirty. */
|
/* Set the depth buffer as dirty. */
|
||||||
if (rctx->framebuffer.zsbuf) {
|
if (rctx->framebuffer.zsbuf) {
|
||||||
struct pipe_surface *surf = rctx->framebuffer.zsbuf;
|
struct pipe_surface *surf = rctx->framebuffer.zsbuf;
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture *)surf->texture;
|
struct r600_texture *rtex = (struct r600_texture *)surf->texture;
|
||||||
|
|
||||||
rtex->dirty_db_mask |= 1 << surf->u.tex.level;
|
rtex->dirty_db_mask |= 1 << surf->u.tex.level;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600
|
||||||
0, &sbox);
|
0, &sbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
|
unsigned r600_texture_get_offset(struct r600_texture *rtex,
|
||||||
unsigned level, unsigned layer)
|
unsigned level, unsigned layer)
|
||||||
{
|
{
|
||||||
return rtex->surface.level[level].offset +
|
return rtex->surface.level[level].offset +
|
||||||
|
|
@ -158,7 +158,7 @@ static int r600_init_surface(struct r600_screen *rscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int r600_setup_surface(struct pipe_screen *screen,
|
static int r600_setup_surface(struct pipe_screen *screen,
|
||||||
struct r600_resource_texture *rtex,
|
struct r600_texture *rtex,
|
||||||
unsigned pitch_in_bytes_override)
|
unsigned pitch_in_bytes_override)
|
||||||
{
|
{
|
||||||
struct pipe_resource *ptex = &rtex->resource.b.b;
|
struct pipe_resource *ptex = &rtex->resource.b.b;
|
||||||
|
|
@ -206,7 +206,7 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
|
||||||
struct pipe_resource *ptex,
|
struct pipe_resource *ptex,
|
||||||
struct winsys_handle *whandle)
|
struct winsys_handle *whandle)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)ptex;
|
struct r600_texture *rtex = (struct r600_texture*)ptex;
|
||||||
struct r600_resource *resource = &rtex->resource;
|
struct r600_resource *resource = &rtex->resource;
|
||||||
struct radeon_surface *surface = &rtex->surface;
|
struct radeon_surface *surface = &rtex->surface;
|
||||||
struct r600_screen *rscreen = (struct r600_screen*)screen;
|
struct r600_screen *rscreen = (struct r600_screen*)screen;
|
||||||
|
|
@ -230,7 +230,7 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
|
||||||
static void r600_texture_destroy(struct pipe_screen *screen,
|
static void r600_texture_destroy(struct pipe_screen *screen,
|
||||||
struct pipe_resource *ptex)
|
struct pipe_resource *ptex)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)ptex;
|
struct r600_texture *rtex = (struct r600_texture*)ptex;
|
||||||
struct r600_resource *resource = &rtex->resource;
|
struct r600_resource *resource = &rtex->resource;
|
||||||
|
|
||||||
if (rtex->flushed_depth_texture)
|
if (rtex->flushed_depth_texture)
|
||||||
|
|
@ -252,7 +252,7 @@ static const struct u_resource_vtbl r600_texture_vtbl =
|
||||||
NULL /* transfer_inline_write */
|
NULL /* transfer_inline_write */
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct r600_resource_texture *
|
static struct r600_texture *
|
||||||
r600_texture_create_object(struct pipe_screen *screen,
|
r600_texture_create_object(struct pipe_screen *screen,
|
||||||
const struct pipe_resource *base,
|
const struct pipe_resource *base,
|
||||||
unsigned pitch_in_bytes_override,
|
unsigned pitch_in_bytes_override,
|
||||||
|
|
@ -260,12 +260,12 @@ r600_texture_create_object(struct pipe_screen *screen,
|
||||||
boolean alloc_bo,
|
boolean alloc_bo,
|
||||||
struct radeon_surface *surface)
|
struct radeon_surface *surface)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex;
|
struct r600_texture *rtex;
|
||||||
struct r600_resource *resource;
|
struct r600_resource *resource;
|
||||||
struct r600_screen *rscreen = (struct r600_screen*)screen;
|
struct r600_screen *rscreen = (struct r600_screen*)screen;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
rtex = CALLOC_STRUCT(r600_resource_texture);
|
rtex = CALLOC_STRUCT(r600_texture);
|
||||||
if (rtex == NULL)
|
if (rtex == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
@ -408,11 +408,11 @@ struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen,
|
||||||
|
|
||||||
bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
|
bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
|
||||||
struct pipe_resource *texture,
|
struct pipe_resource *texture,
|
||||||
struct r600_resource_texture **staging)
|
struct r600_texture **staging)
|
||||||
{
|
{
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
|
struct r600_texture *rtex = (struct r600_texture*)texture;
|
||||||
struct pipe_resource resource;
|
struct pipe_resource resource;
|
||||||
struct r600_resource_texture **flushed_depth_texture = staging ?
|
struct r600_texture **flushed_depth_texture = staging ?
|
||||||
staging : &rtex->flushed_depth_texture;
|
staging : &rtex->flushed_depth_texture;
|
||||||
|
|
||||||
if (!staging && rtex->flushed_depth_texture)
|
if (!staging && rtex->flushed_depth_texture)
|
||||||
|
|
@ -433,7 +433,7 @@ bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
|
||||||
if (staging)
|
if (staging)
|
||||||
resource.flags |= R600_RESOURCE_FLAG_TRANSFER;
|
resource.flags |= R600_RESOURCE_FLAG_TRANSFER;
|
||||||
|
|
||||||
*flushed_depth_texture = (struct r600_resource_texture *)ctx->screen->resource_create(ctx->screen, &resource);
|
*flushed_depth_texture = (struct r600_texture *)ctx->screen->resource_create(ctx->screen, &resource);
|
||||||
if (*flushed_depth_texture == NULL) {
|
if (*flushed_depth_texture == NULL) {
|
||||||
R600_ERR("failed to create temporary texture to hold flushed depth\n");
|
R600_ERR("failed to create temporary texture to hold flushed depth\n");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -457,7 +457,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
||||||
const struct pipe_box *box)
|
const struct pipe_box *box)
|
||||||
{
|
{
|
||||||
struct r600_context *rctx = (struct r600_context*)ctx;
|
struct r600_context *rctx = (struct r600_context*)ctx;
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
|
struct r600_texture *rtex = (struct r600_texture*)texture;
|
||||||
struct pipe_resource resource;
|
struct pipe_resource resource;
|
||||||
struct r600_transfer *trans;
|
struct r600_transfer *trans;
|
||||||
boolean use_staging_texture = FALSE;
|
boolean use_staging_texture = FALSE;
|
||||||
|
|
@ -503,7 +503,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
||||||
*/
|
*/
|
||||||
/* XXX: when discard is true, no need to read back from depth texture
|
/* XXX: when discard is true, no need to read back from depth texture
|
||||||
*/
|
*/
|
||||||
struct r600_resource_texture *staging_depth;
|
struct r600_texture *staging_depth;
|
||||||
|
|
||||||
if (!r600_init_flushed_depth_texture(ctx, texture, &staging_depth)) {
|
if (!r600_init_flushed_depth_texture(ctx, texture, &staging_depth)) {
|
||||||
R600_ERR("failed to create temporary texture to hold untiled copy\n");
|
R600_ERR("failed to create temporary texture to hold untiled copy\n");
|
||||||
|
|
@ -553,7 +553,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
trans->transfer.stride =
|
trans->transfer.stride =
|
||||||
((struct r600_resource_texture *)trans->staging)->surface.level[0].pitch_bytes;
|
((struct r600_texture *)trans->staging)->surface.level[0].pitch_bytes;
|
||||||
if (usage & PIPE_TRANSFER_READ) {
|
if (usage & PIPE_TRANSFER_READ) {
|
||||||
r600_copy_to_staging_texture(ctx, trans);
|
r600_copy_to_staging_texture(ctx, trans);
|
||||||
/* Always referenced in the blit. */
|
/* Always referenced in the blit. */
|
||||||
|
|
@ -572,7 +572,7 @@ void r600_texture_transfer_destroy(struct pipe_context *ctx,
|
||||||
{
|
{
|
||||||
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
|
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
|
||||||
struct pipe_resource *texture = transfer->resource;
|
struct pipe_resource *texture = transfer->resource;
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
|
struct r600_texture *rtex = (struct r600_texture*)texture;
|
||||||
|
|
||||||
if ((transfer->usage & PIPE_TRANSFER_WRITE) && rtransfer->staging) {
|
if ((transfer->usage & PIPE_TRANSFER_WRITE) && rtransfer->staging) {
|
||||||
if (rtex->is_depth) {
|
if (rtex->is_depth) {
|
||||||
|
|
@ -598,8 +598,8 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
|
||||||
struct r600_context *rctx = (struct r600_context *)ctx;
|
struct r600_context *rctx = (struct r600_context *)ctx;
|
||||||
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
|
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
|
||||||
struct radeon_winsys_cs_handle *buf;
|
struct radeon_winsys_cs_handle *buf;
|
||||||
struct r600_resource_texture *rtex =
|
struct r600_texture *rtex =
|
||||||
(struct r600_resource_texture*)transfer->resource;
|
(struct r600_texture*)transfer->resource;
|
||||||
enum pipe_format format = transfer->resource->format;
|
enum pipe_format format = transfer->resource->format;
|
||||||
unsigned offset = 0;
|
unsigned offset = 0;
|
||||||
char *map;
|
char *map;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue