view->tex_resource_words[2] = (surflevel[0].offset + r600_resource_va(ctx->screen, texture)) >> 8;
/* TEX_RESOURCE_WORD3.MIP_ADDRESS */
- if (texture->nr_samples > 1 && rscreen->msaa_texture_support == MSAA_TEXTURE_COMPRESSED) {
+ if (texture->nr_samples > 1 && rscreen->has_compressed_msaa_texturing) {
if (tmp->is_depth) {
/* disable FMASK (0 = disabled) */
view->tex_resource_words[3] = 0;
void *evergreen_create_decompress_blend(struct r600_context *rctx)
{
struct pipe_blend_state blend;
+ unsigned mode = rctx->screen->has_compressed_msaa_texturing ?
+ V_028808_CB_FMASK_DECOMPRESS : V_028808_CB_DECOMPRESS;
memset(&blend, 0, sizeof(blend));
blend.independent_blend_enable = true;
blend.rt[0].colormask = 0xf;
- return evergreen_create_blend_state_mode(&rctx->context, &blend, V_028808_CB_DECOMPRESS);
-}
-
-void *evergreen_create_fmask_decompress_blend(struct r600_context *rctx)
-{
- struct pipe_blend_state blend;
-
- memset(&blend, 0, sizeof(blend));
- blend.independent_blend_enable = true;
- blend.rt[0].colormask = 0xf;
- return evergreen_create_blend_state_mode(&rctx->context, &blend, V_028808_CB_FMASK_DECOMPRESS);
+ return evergreen_create_blend_state_mode(&rctx->context, &blend, mode);
}
void *evergreen_create_db_flush_dsa(struct r600_context *rctx)
void r600_bytecode_init(struct r600_bytecode *bc,
enum chip_class chip_class,
enum radeon_family family,
- enum r600_msaa_texture_mode msaa_texture_mode)
+ bool has_compressed_msaa_texturing)
{
static unsigned next_shader_id = 0;
LIST_INITHEAD(&bc->cf);
bc->chip_class = chip_class;
- bc->msaa_texture_mode = msaa_texture_mode;
+ bc->has_compressed_msaa_texturing = has_compressed_msaa_texturing;
bc->stack.entry_size = stack_entry_size(family);
}
memset(&bc, 0, sizeof(bc));
r600_bytecode_init(&bc, rctx->chip_class, rctx->family,
- rctx->screen->msaa_texture_support);
+ rctx->screen->has_compressed_msaa_texturing);
bc.isa = rctx->isa;
struct r600_bytecode {
enum chip_class chip_class;
- enum r600_msaa_texture_mode msaa_texture_mode;
+ bool has_compressed_msaa_texturing;
int type;
struct list_head cf;
struct r600_bytecode_cf *cf_last;
void r600_bytecode_init(struct r600_bytecode *bc,
enum chip_class chip_class,
enum radeon_family family,
- enum r600_msaa_texture_mode msaa_texture_mode);
+ bool has_compressed_msaa_texturing);
void r600_bytecode_clear(struct r600_bytecode *bc);
int r600_bytecode_add_alu(struct r600_bytecode *bc,
const struct r600_bytecode_alu *alu);
{
struct r600_context *rctx = (struct r600_context *)ctx;
unsigned layer, level, checked_last_layer, max_layer;
- void *blend_decompress;
if (!rtex->dirty_level_mask)
return;
- switch (rctx->screen->msaa_texture_support) {
- case MSAA_TEXTURE_DECOMPRESSED:
- blend_decompress = rctx->custom_blend_decompress;
- break;
- case MSAA_TEXTURE_COMPRESSED:
- blend_decompress = rctx->custom_blend_fmask_decompress;
- break;
- case MSAA_TEXTURE_SAMPLE_ZERO:
- default:
- /* Nothing to do. */
- rtex->dirty_level_mask = 0;
- return;
- }
-
for (level = first_level; level <= last_level; level++) {
if (!(rtex->dirty_level_mask & (1 << level)))
continue;
cbsurf = ctx->create_surface(ctx, &rtex->resource.b.b, &surf_tmpl);
r600_blitter_begin(ctx, R600_DECOMPRESS);
- util_blitter_custom_color(rctx->blitter, cbsurf, blend_decompress);
+ util_blitter_custom_color(rctx->blitter, cbsurf, rctx->custom_blend_decompress);
r600_blitter_end(ctx);
pipe_surface_reference(&cbsurf, NULL);
struct pipe_sampler_view src_templ, *src_view;
unsigned dst_width, dst_height, src_width0, src_height0, src_widthFL, src_heightFL;
struct pipe_box sbox, dstbox;
- bool copy_all_samples;
/* Handle buffers first. */
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
src_widthFL, src_heightFL);
}
- copy_all_samples = rctx->screen->msaa_texture_support != MSAA_TEXTURE_SAMPLE_ZERO;
-
u_box_3d(dstx, dsty, dstz, abs(src_box->width), abs(src_box->height),
abs(src_box->depth), &dstbox);
util_blitter_blit_generic(rctx->blitter, dst_view, &dstbox,
src_view, src_box, src_width0, src_height0,
PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL,
- copy_all_samples);
+ TRUE);
r600_blitter_end(ctx);
pipe_surface_reference(&dst_view, NULL);
if (rctx->custom_blend_decompress) {
rctx->context.delete_blend_state(&rctx->context, rctx->custom_blend_decompress);
}
- if (rctx->custom_blend_fmask_decompress) {
- rctx->context.delete_blend_state(&rctx->context, rctx->custom_blend_fmask_decompress);
- }
util_unreference_framebuffer_state(&rctx->framebuffer.state);
if (rctx->blitter) {
rctx->custom_dsa_flush = evergreen_create_db_flush_dsa(rctx);
rctx->custom_blend_resolve = evergreen_create_resolve_blend(rctx);
rctx->custom_blend_decompress = evergreen_create_decompress_blend(rctx);
- rctx->custom_blend_fmask_decompress = evergreen_create_fmask_decompress_blend(rctx);
rctx->has_vertex_cache = !(rctx->family == CHIP_CEDAR ||
rctx->family == CHIP_PALM ||
rctx->family == CHIP_SUMO ||
case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
+ case PIPE_CAP_TEXTURE_MULTISAMPLE:
return 1;
+
case PIPE_CAP_TGSI_TEXCOORD:
return 0;
case PIPE_CAP_GLSL_FEATURE_LEVEL:
return 140;
- case PIPE_CAP_TEXTURE_MULTISAMPLE:
- return rscreen->msaa_texture_support != MSAA_TEXTURE_SAMPLE_ZERO;
-
/* Supported except the original R600. */
case PIPE_CAP_INDEP_BLEND_ENABLE:
case PIPE_CAP_INDEP_BLEND_FUNC:
case R600:
case R700:
rscreen->has_msaa = rscreen->info.drm_minor >= 22;
- rscreen->msaa_texture_support = MSAA_TEXTURE_DECOMPRESSED;
+ rscreen->has_compressed_msaa_texturing = false;
break;
case EVERGREEN:
rscreen->has_msaa = rscreen->info.drm_minor >= 19;
- rscreen->msaa_texture_support =
- rscreen->info.drm_minor >= 24 ? MSAA_TEXTURE_COMPRESSED :
- MSAA_TEXTURE_DECOMPRESSED;
+ rscreen->has_compressed_msaa_texturing = rscreen->info.drm_minor >= 24;
break;
case CAYMAN:
rscreen->has_msaa = rscreen->info.drm_minor >= 19;
- rscreen->msaa_texture_support = MSAA_TEXTURE_COMPRESSED;
+ rscreen->has_compressed_msaa_texturing = true;
break;
default:
rscreen->has_msaa = FALSE;
- rscreen->msaa_texture_support = 0;
- break;
+ rscreen->has_compressed_msaa_texturing = false;
}
rscreen->has_cp_dma = rscreen->info.drm_minor >= 27 &&
pipe_mutex mutex;
};
-enum r600_msaa_texture_mode {
- /* If the hw can fetch the first sample only (no decompression available).
- * This means MSAA texturing is not fully implemented. */
- MSAA_TEXTURE_SAMPLE_ZERO,
-
- /* If the hw can fetch decompressed MSAA textures.
- * Supported families: R600, R700, Evergreen.
- * Cayman cannot use this, because it cannot do the decompression. */
- MSAA_TEXTURE_DECOMPRESSED,
-
- /* If the hw can fetch compressed MSAA textures, which means shaders can
- * read resolved FMASK. This yields the best performance.
- * Supported families: Evergreen, Cayman. */
- MSAA_TEXTURE_COMPRESSED
-};
-
typedef boolean (*r600g_dma_blit_t)(struct pipe_context *ctx,
struct pipe_resource *dst,
unsigned dst_level,
bool has_streamout;
bool has_msaa;
bool has_cp_dma;
- enum r600_msaa_texture_mode msaa_texture_support;
+ bool has_compressed_msaa_texturing;
struct r600_tiling_info tiling_info;
struct r600_pipe_fences fences;
void *custom_dsa_flush;
void *custom_blend_resolve;
void *custom_blend_decompress;
- void *custom_blend_fmask_decompress;
/* With rasterizer discard, there doesn't have to be a pixel shader.
* In that case, we bind this one: */
void *dummy_pixel_shader;
void *evergreen_create_db_flush_dsa(struct r600_context *rctx);
void *evergreen_create_resolve_blend(struct r600_context *rctx);
void *evergreen_create_decompress_blend(struct r600_context *rctx);
-void *evergreen_create_fmask_decompress_blend(struct r600_context *rctx);
boolean evergreen_is_format_supported(struct pipe_screen *screen,
enum pipe_format format,
enum pipe_texture_target target,
ctx.native_integers = true;
r600_bytecode_init(ctx.bc, rscreen->chip_class, rscreen->family,
- rscreen->msaa_texture_support);
+ rscreen->has_compressed_msaa_texturing);
ctx.tokens = tokens;
tgsi_scan_shader(tokens, &ctx.info);
shader->indirect_files = ctx.info.indirect_files;
unsigned src_gpr;
int r, i, j;
int opcode;
- bool read_compressed_msaa = ctx->bc->msaa_texture_mode == MSAA_TEXTURE_COMPRESSED &&
+ bool read_compressed_msaa = ctx->bc->has_compressed_msaa_texturing &&
inst->Instruction.Opcode == TGSI_OPCODE_TXF &&
(inst->Texture.Texture == TGSI_TEXTURE_2D_MSAA ||
inst->Texture.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA);
+
/* Texture fetch instructions can only use gprs as source.
* Also they cannot negate the source or take the absolute value */
const boolean src_requires_loading = (inst->Instruction.Opcode != TGSI_OPCODE_TXQ_LZ &&