diff options
author | Dave Airlie <[email protected]> | 2016-11-24 00:18:21 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-11-29 22:48:03 +0000 |
commit | f3a3fea973a145fe16f70866dcfc22c3c5322a91 (patch) | |
tree | 0faefa4b5267b3f0d070885a68c446c432aa56df /src/amd/common | |
parent | 6a62026dd46a267eb861bcdf8a7db449745aa32e (diff) |
radv: force persample shading when required.
We need to force persample shading when
a) shader uses sample_id
b) shader uses sample_position
c) shader uses sample qualifier.
Also since ps_iter_samples can now change independently of the
rasterizer samples we need to move setting the regs more often.
This fixes:
dEQP-VK.pipeline.multisample_interpolation.centroid_interpolate_at_consistency.*
dEQP-VK.pipeline.multisample_interpolation.centroid_qualifier_inside_primitive.137_191_1.*
dEQP-VK.pipeline.multisample_interpolation.sample_interpolate_at_distinct_values.*
dEQP-VK.pipeline.multisample_interpolation.sample_qualifier_distinct_values.128_128_1.*
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 17 | ||||
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.h | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index d9eef5749e0..ee98f5f88e8 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -2940,9 +2940,11 @@ static void visit_intrinsic(struct nir_to_llvm_context *ctx, result = ctx->start_instance; break; case nir_intrinsic_load_sample_id: + ctx->shader_info->fs.force_persample = true; result = unpack_param(ctx, ctx->ancillary, 8, 4); break; case nir_intrinsic_load_sample_pos: + ctx->shader_info->fs.force_persample = true; result = load_sample_pos(ctx); break; case nir_intrinsic_load_front_face: @@ -3959,9 +3961,18 @@ handle_fs_input_decl(struct nir_to_llvm_context *ctx, variable->data.driver_location = idx * 4; ctx->input_mask |= ((1ull << attrib_count) - 1) << variable->data.location; - if (glsl_get_base_type(glsl_without_array(variable->type)) == GLSL_TYPE_FLOAT) - interp = lookup_interp_param(ctx, variable->data.interpolation, INTERP_CENTER); - else + if (glsl_get_base_type(glsl_without_array(variable->type)) == GLSL_TYPE_FLOAT) { + unsigned interp_type; + if (variable->data.sample) { + interp_type = INTERP_SAMPLE; + ctx->shader_info->fs.force_persample = true; + } else if (variable->data.centroid) + interp_type = INTERP_CENTROID; + else + interp_type = INTERP_CENTER; + + interp = lookup_interp_param(ctx, variable->data.interpolation, interp_type); + } else interp = NULL; for (unsigned i = 0; i < attrib_count; ++i) diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h index ca06d059a6d..f33519ccca3 100644 --- a/src/amd/common/ac_nir_to_llvm.h +++ b/src/amd/common/ac_nir_to_llvm.h @@ -81,6 +81,7 @@ struct ac_shader_variant_info { bool writes_stencil; bool early_fragment_test; bool writes_memory; + bool force_persample; } fs; struct { unsigned block_size[3]; |