mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
i965/miptree: Take an isl_format in prepare_texture
This will be a bit more convenient momentarily. It's also more correct because it makes prepare_texture take sRGB into account.
This commit is contained in:
parent
2ccfc0ffdd
commit
fe38d3e3a4
3 changed files with 13 additions and 12 deletions
|
|
@ -383,8 +383,12 @@ brw_predraw_resolve_inputs(struct brw_context *brw)
|
|||
if (!tex_obj || !tex_obj->mt)
|
||||
continue;
|
||||
|
||||
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, i);
|
||||
enum isl_format view_format =
|
||||
translate_tex_format(brw, tex_obj->_Format, sampler->sRGBDecode);
|
||||
|
||||
bool aux_supported;
|
||||
intel_miptree_prepare_texture(brw, tex_obj->mt, tex_obj->_Format,
|
||||
intel_miptree_prepare_texture(brw, tex_obj->mt, view_format,
|
||||
&aux_supported);
|
||||
|
||||
if (!aux_supported && brw->gen >= 9 &&
|
||||
|
|
|
|||
|
|
@ -2464,18 +2464,15 @@ intel_miptree_set_aux_state(struct brw_context *brw,
|
|||
static bool
|
||||
can_texture_with_ccs(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
mesa_format view_format)
|
||||
enum isl_format view_format)
|
||||
{
|
||||
if (mt->aux_usage != ISL_AUX_USAGE_CCS_E)
|
||||
return false;
|
||||
|
||||
enum isl_format isl_mt_format = brw_isl_format_for_mesa_format(mt->format);
|
||||
enum isl_format isl_view_format = brw_isl_format_for_mesa_format(view_format);
|
||||
|
||||
if (!isl_formats_are_ccs_e_compatible(&brw->screen->devinfo,
|
||||
isl_mt_format, isl_view_format)) {
|
||||
mt->surf.format, view_format)) {
|
||||
perf_debug("Incompatible sampling format (%s) for rbc (%s)\n",
|
||||
_mesa_get_format_name(view_format),
|
||||
isl_format_get_layout(view_format)->name,
|
||||
_mesa_get_format_name(mt->format));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2513,7 +2510,7 @@ intel_miptree_texture_aux_usage(struct brw_context *brw,
|
|||
static void
|
||||
intel_miptree_prepare_texture_slices(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
mesa_format view_format,
|
||||
enum isl_format view_format,
|
||||
uint32_t start_level, uint32_t num_levels,
|
||||
uint32_t start_layer, uint32_t num_layers,
|
||||
bool *aux_supported_out)
|
||||
|
|
@ -2526,7 +2523,7 @@ intel_miptree_prepare_texture_slices(struct brw_context *brw,
|
|||
* the sampler. If we have a texture view, we would have to perform the
|
||||
* clear color conversion manually. Just disable clear color.
|
||||
*/
|
||||
if (mt->format != view_format)
|
||||
if (mt->surf.format != view_format)
|
||||
clear_supported = false;
|
||||
|
||||
intel_miptree_prepare_access(brw, mt, start_level, num_levels,
|
||||
|
|
@ -2539,7 +2536,7 @@ intel_miptree_prepare_texture_slices(struct brw_context *brw,
|
|||
void
|
||||
intel_miptree_prepare_texture(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
mesa_format view_format,
|
||||
enum isl_format view_format,
|
||||
bool *aux_supported_out)
|
||||
{
|
||||
intel_miptree_prepare_texture_slices(brw, mt, view_format,
|
||||
|
|
@ -2563,7 +2560,7 @@ intel_miptree_prepare_fb_fetch(struct brw_context *brw,
|
|||
struct intel_mipmap_tree *mt, uint32_t level,
|
||||
uint32_t start_layer, uint32_t num_layers)
|
||||
{
|
||||
intel_miptree_prepare_texture_slices(brw, mt, mt->format, level, 1,
|
||||
intel_miptree_prepare_texture_slices(brw, mt, mt->surf.format, level, 1,
|
||||
start_layer, num_layers, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -618,7 +618,7 @@ intel_miptree_texture_aux_usage(struct brw_context *brw,
|
|||
void
|
||||
intel_miptree_prepare_texture(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
mesa_format view_format,
|
||||
enum isl_format view_format,
|
||||
bool *aux_supported_out);
|
||||
void
|
||||
intel_miptree_prepare_image(struct brw_context *brw,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue