anv/pipeline: remove unnecessary null-pointer check
authorAndrii Simiklit <andrii.simiklit@globallogic.com>
Wed, 9 Jan 2019 13:39:45 +0000 (15:39 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 Jan 2019 18:29:12 +0000 (12:29 -0600)
Looks like it is impossible that 'last' variable is a null
because at least the get_vs_prog_data shouldn't return a null pointer.
So this check is unnecessary starts from commit:
99d497c5b691 "anv/pipeline: Replace get_fs_input_map with ..."

This small issue is found by cppcheck.

Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_pipeline.c

index d39a0da12daaac7148687fa5e5035de189578f41..e52e5d8304ac50ec34b3a977d713bf43b302f066 100644 (file)
@@ -1116,10 +1116,8 @@ emit_3dstate_clip(struct anv_pipeline *pipeline,
       clip.FrontWinding            = vk_to_gen_front_face[rs_info->frontFace];
       clip.CullMode                = vk_to_gen_cullmode[rs_info->cullMode];
       clip.ViewportZClipTestEnable = !pipeline->depth_clamp_enable;
-      if (last) {
-         clip.UserClipDistanceClipTestEnableBitmask = last->clip_distance_mask;
-         clip.UserClipDistanceCullTestEnableBitmask = last->cull_distance_mask;
-      }
+      clip.UserClipDistanceClipTestEnableBitmask = last->clip_distance_mask;
+      clip.UserClipDistanceCullTestEnableBitmask = last->cull_distance_mask;
 #else
       clip.NonPerspectiveBarycentricEnable = wm_prog_data ?
          (wm_prog_data->barycentric_interp_modes &