17 mar 2017 10:01 "Alejandro Piñeiro" <apinhe...@igalia.com> napisał(a):
On 17/03/17 06:26, Edward O'Callaghan wrote: > We memset number of elements without multiplication by the > element size. > > Signed-off-by: Edward O'Callaghan <funfunc...@folklore1984.net> > --- > src/mesa/main/formatquery.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c > index 598d34d..50d7c31 100644 > --- a/src/mesa/main/formatquery.c > +++ b/src/mesa/main/formatquery.c > @@ -1564,7 +1564,7 @@ _mesa_GetInternalformati64v(GLenum target, GLenum internalformat, > * no pname can return a negative value, we fill params32 with negative > * values as reference values, that can be used to know what copy-back to > * params */ > - memset(params32, -1, 16); Urgh. Yes, this code is wrong, sorry. When I wrote it the idea is initialize params32 elements to -1. But memset initilizes byte-per-byte. Im not even sure if the resulting GLint value is still negative as intended. In 2s complement arithmetic, memsetting all bytes to -1 is the same as setting all dwords to -1 since both have a representation of all 1 bits. Though it's better to leave a memset transformation to the compiler. Regards, Gustaw
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev