radv: move setting can_discard to ac_fill_shader_info()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 28 Aug 2019 14:52:30 +0000 (16:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 30 Aug 2019 07:33:27 +0000 (09:33 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_nir_to_llvm.c

index b4ee28f4d370dc0d0f9ebd184043557eac9d0335..1c1633a51e77486e391b88bd4f606c163939f76c 100644 (file)
@@ -4298,7 +4298,6 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
                } else if (shaders[i]->info.stage == MESA_SHADER_VERTEX) {
                        ctx.abi.load_base_vertex = radv_load_base_vertex;
                } else if (shaders[i]->info.stage == MESA_SHADER_FRAGMENT) {
-                       shader_info->fs.can_discard = shaders[i]->info.fs.uses_discard;
                        ctx.abi.load_sample_position = load_sample_position;
                        ctx.abi.load_sample_mask_in = load_sample_mask_in;
                        ctx.abi.emit_kill = radv_emit_kill;
@@ -4521,6 +4520,7 @@ ac_fill_shader_info(struct radv_shader_variant_info *shader_info, struct nir_sha
                         shader_info->cs.block_size[i] = nir->info.cs.local_size[i];
                 break;
         case MESA_SHADER_FRAGMENT:
+               shader_info->fs.can_discard = nir->info.fs.uses_discard;
                 shader_info->fs.early_fragment_test = nir->info.fs.early_fragment_tests;
                 shader_info->fs.post_depth_coverage = nir->info.fs.post_depth_coverage;
                 break;