Commit 10189560 authored by Icecream95's avatar Icecream95

panfrost: Support emulated S3TC

parent 1e5fa3d2
Pipeline #228877 waiting for manual action with stages
in 19 seconds
......@@ -957,7 +957,8 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
bool fake_rgtc = !panfrost_supports_compressed_format(device, MALI_BC4_UNORM);
if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC && fake_rgtc) {
if ((desc->layout == UTIL_FORMAT_LAYOUT_RGTC ||
desc->layout == UTIL_FORMAT_LAYOUT_S3TC) && fake_rgtc) {
if (desc->is_snorm)
format = PIPE_FORMAT_R8G8B8A8_SNORM;
else
......
......@@ -717,8 +717,9 @@ pan_blit_format(enum pipe_format fmt)
desc = util_format_description(fmt);
/* This must be an emulated format (using u_transfer_helper) as if it
* was real RGTC we wouldn't have used AFBC and needed a blit. */
if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC)
* was compressed we wouldn't have used AFBC and needed a blit. */
if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC ||
desc->layout == UTIL_FORMAT_LAYOUT_S3TC)
fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
return fmt;
......@@ -1175,7 +1176,8 @@ panfrost_resource_screen_init(struct pipe_screen *pscreen)
pscreen->resource_get_handle = panfrost_resource_get_handle;
pscreen->transfer_helper = u_transfer_helper_create(&transfer_vtbl,
TRANS_HELP_SEP_Z32S8 | TRANS_HELP_MSAA_MAP |
(fake_rgtc ? TRANS_HELP_FAKE_RGTC : 0));
(fake_rgtc ? TRANS_HELP_FAKE_RGTC |
TRANS_HELP_FAKE_S3TC : 0));
}
void
......
......@@ -491,12 +491,13 @@ panfrost_is_format_supported( struct pipe_screen *screen,
/* Also check that compressed texture formats are supported on this
* particular chip. They may not be depending on system integration
* differences. RGTC can be emulated so is always supported. */
* differences. S3TC / RGTC can be emulated so is always supported. */
bool is_rgtc = format_desc->layout == UTIL_FORMAT_LAYOUT_RGTC;
bool is_faked = format_desc->layout == UTIL_FORMAT_LAYOUT_RGTC ||
format_desc->layout == UTIL_FORMAT_LAYOUT_S3TC;
bool supported = panfrost_supports_compressed_format(dev, indexed);
if (!is_rgtc && !supported)
if (!is_faked && !supported)
return false;
return indexed && ((relevant_bind & ~fmt.bind) == 0);
......
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