Adam Jackson wrote: > On Mon, 2019-01-28 at 10:42 -0800, Kevin Strasser wrote: > > @@ -237,19 +268,35 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig > > *dri_config, int id, > > break; > > > > case __DRI_ATTRIB_RED_MASK: > > - dri_masks[0] = value; > > + dri_shifts[0] = ffs(value) - 1; > > + break; > > + > > + case __DRI_ATTRIB_RED_SHIFT: > > + dri_shifts[0] = value; > > break; > > I kind of want some paranoia here (for both cases) along the lines of: > > int shift = dri_shifts[x]; > if (shift != -1 && shift != value /* or ffs(value) - 1 */) > assert(!"inconsistent config mask/shift"); > > That's probably being too cautious, certainly not worth blocking this > series for.
I can see how that might save some headaches for developers adding additional formats. I'll submit a follow up patch to add that assert here and in the dri2_get_rgba_shift helper function. Thanks, Kevin _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev