From: Jason Ekstrand Date: Wed, 23 Dec 2015 19:24:23 +0000 (-0800) Subject: anv: Mask out invalid stages in foreach_stage X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72ceb99bab592e1ce01bc7855c45bfe58a188b6f;p=mesa.git anv: Mask out invalid stages in foreach_stage --- diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index b632f6e85a9..6bd18952492 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -1235,8 +1235,11 @@ mesa_to_vk_shader_stage(gl_shader_stage mesa_stage) return (1 << mesa_stage); } +#define ANV_STAGE_MASK ((1 << MESA_SHADER_STAGES) - 1) + #define anv_foreach_stage(stage, stage_bits) \ - for (gl_shader_stage stage, __tmp = (gl_shader_stage)(stage_bits);\ + for (gl_shader_stage stage, \ + __tmp = (gl_shader_stage)((stage_bits) & ANV_STAGE_MASK); \ stage = __builtin_ffs(__tmp) - 1, __tmp; \ __tmp &= ~(1 << (stage)))