Commit ce989615 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Fixes to restore RGBA texture support

parent 6a018961
......@@ -1598,7 +1598,7 @@ panfrost_create_sampler_view(
/* TODO: Decode */
.format = {
.bottom = 0x20,
.bottom = 0x88,
.unk1 = 0xb,
.component_size = 0x3,
.nr_channels = MALI_POSITIVE(prsrc->bytes_per_pixel),
......@@ -1679,10 +1679,7 @@ panfrost_resource_create_front(struct pipe_screen *screen,
}
/* Fill out fields based on format itself */
//const struct util_format_description *desc = util_format_description(fmt);
//so->bytes_per_pixel = util_format_get_blocksize(template->format);
so->bytes_per_pixel = 1;
so->bytes_per_pixel = util_format_get_blocksize(template->format);
#else
so->bytes_per_pixel = 4;
#endif
......@@ -1726,16 +1723,16 @@ panfrost_transfer_map(struct pipe_context *pctx,
const struct pipe_box *box,
struct pipe_transfer **out_transfer)
{
struct panfrost_resource *rsrc = (struct panfrost_resource *) resource;
struct pipe_transfer *transfer = CALLOC_STRUCT(pipe_transfer);
transfer->resource = resource;
transfer->level = level;
transfer->usage = usage;
transfer->box = *box;
transfer->stride = resource->width0 * 1 /* XXX: non RGBA */;
transfer->stride = resource->width0 * rsrc->bytes_per_pixel;
*out_transfer = transfer;
struct panfrost_resource *rsrc = (struct panfrost_resource *) resource;
assert(!transfer->box.z);
/* If non-zero level, it's a mipmapped resource and needs to be treated as such */
......@@ -2022,7 +2019,6 @@ panfrost_destroy(struct pipe_context *pipe)
static void
panfrost_tile_texture(struct panfrost_context *ctx, struct panfrost_resource *rsrc, int level)
{
printf("bpp %d\n", rsrc->bytes_per_pixel);
int width = rsrc->base.width0 >> level;
int height = rsrc->base.height0 >> level;
int stride = width * rsrc->bytes_per_pixel; /* TODO: Alignment? */
......
......@@ -211,7 +211,7 @@ struct panfrost_resource {
/* Is something other than level 0 ever written? */
bool is_mipmap;
/* Only valid for textures */
/* Valid for textures; 1 otherwise */
int bytes_per_pixel;
struct sw_displaytarget *dt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment