diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2012-11-22 16:23:21 +1300 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2012-11-26 16:34:28 -0800 |
commit | c3c680950d9f7736723469ff74d0a3c9bbcaaeb1 (patch) | |
tree | 69e35deda04761dd6b486c7d63461e9f53c2dd3d /src/mesa/drivers/dri/i965/brw_vs.h | |
parent | 23f4411c41f96a1b755259c4a6b23747e95a5ece (diff) | |
download | external_mesa3d-c3c680950d9f7736723469ff74d0a3c9bbcaaeb1.zip external_mesa3d-c3c680950d9f7736723469ff74d0a3c9bbcaaeb1.tar.gz external_mesa3d-c3c680950d9f7736723469ff74d0a3c9bbcaaeb1.tar.bz2 |
i965: Generalize GL_FIXED VS w/a support
Next few patches build on this to add other workarounds
for packed formats.
V2: rename BRW_ATTRIB_WA_COMPONENTS to BRW_ATTRIB_WA_COMPONENT_MASK;
V3 (Kayden): remove separate bit for ES3 signed normalization
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index 8edc92f..279c18f 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -39,13 +39,24 @@ #include "brw_program.h" #include "program/program.h" +/** + * The VF can't natively handle certain types of attributes, such as GL_FIXED + * or most 10_10_10_2 types. These flags enable various VS workarounds to + * "fix" attributes at the beginning of shaders. + */ +#define BRW_ATTRIB_WA_COMPONENT_MASK 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 */ struct brw_vs_prog_key { GLuint program_string_id; - /** - * Number of channels of the vertex attribute that need GL_FIXED rescaling + + /* + * Per-attribute workaround flags */ - uint8_t gl_fixed_input_size[VERT_ATTRIB_MAX]; + uint8_t gl_attrib_wa_flags[VERT_ATTRIB_MAX]; /** * True if at least one clip flag is enabled, regardless of whether the |