[Mesa-dev] [PATCH 3/6] i965: Generalize GL_FIXED VS w/a support

Eric Anholt eric at anholt.net
Mon Oct 22 10:21:48 PDT 2012


Chris Forbes <chrisf at ijw.co.nz> writes:

> Next few patches build on this to add other workarounds
> for packed formats.

> diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
> index adeff7f..9da4cb0 100644
> --- a/src/mesa/drivers/dri/i965/brw_vs.h
> +++ b/src/mesa/drivers/dri/i965/brw_vs.h
> @@ -39,13 +39,21 @@
>  #include "brw_program.h"
>  #include "program/program.h"
>  
> +/* fixup bits for gl_packed_input_flags,
> + * to enable various VS workarounds */
> +#define BRW_ATTRIB_WA_COMPONENTS    7  /* mask for GL_FIXED scale channel count */
> +#define BRW_ATTRIB_WA_NORMALIZE     8  /* normalize in shader */
> +#define BRW_ATTRIB_WA_BGRA          16 /* swap r/b channels in shader */
> +#define BRW_ATTRIB_WA_SIGN          32 /* interpret as signed in shader */
> +#define BRW_ATTRIB_WA_SCALE         64 /* interpret as scaled in shader */

For bitmasks, we usually call a more-than-one-bit mask
BRW_WHATEVER_MASK.  Perhaps BRW_ATTRIB_GL_FIXED_COMPONENTS_MASK?.  For
the others, (1 << bit) as the value is preferred.  I think
BRA_ATTRIB_WA_SCALE whould be BRW_ATTRIB_WA_NORMALIZED, since in our
hardware SCALED refers to casting the integer value to a float, and the
last thing we need in vertex upload is more confusion about formats! :)

Other than that, looks good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121022/a2983c4a/attachment.pgp>


More information about the mesa-dev mailing list