mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
Get rid of _mesa_frag_attrib_to_vert_result().
Now that there is no difference between the enums that represent vertex outputs and fragment inputs, there's no need for a conversion function. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
10a131211e
commit
f117abe664
2 changed files with 8 additions and 33 deletions
|
|
@ -56,24 +56,23 @@ uint32_t
|
|||
get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset,
|
||||
int fs_attr, bool two_side_color, uint32_t *max_source_attr)
|
||||
{
|
||||
int vs_attr = _mesa_frag_attrib_to_vert_result(fs_attr);
|
||||
if (vs_attr < 0 || vs_attr == VARYING_SLOT_POS) {
|
||||
/* These attributes will be overwritten by the fragment shader's
|
||||
* interpolation code (see emit_interp() in brw_wm_fp.c), so just let
|
||||
* them reference the first available attribute.
|
||||
if (fs_attr == FRAG_ATTRIB_WPOS) {
|
||||
/* This attribute will be overwritten by the fragment shader's
|
||||
* interpolation code (see emit_interp() in brw_wm_fp.c), so just let it
|
||||
* reference the first available attribute.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Find the VUE slot for this attribute. */
|
||||
int slot = vue_map->vert_result_to_slot[vs_attr];
|
||||
int slot = vue_map->vert_result_to_slot[fs_attr];
|
||||
|
||||
/* If there was only a back color written but not front, use back
|
||||
* as the color instead of undefined
|
||||
*/
|
||||
if (slot == -1 && vs_attr == VARYING_SLOT_COL0)
|
||||
if (slot == -1 && fs_attr == VARYING_SLOT_COL0)
|
||||
slot = vue_map->vert_result_to_slot[VARYING_SLOT_BFC0];
|
||||
if (slot == -1 && vs_attr == VARYING_SLOT_COL1)
|
||||
if (slot == -1 && fs_attr == VARYING_SLOT_COL1)
|
||||
slot = vue_map->vert_result_to_slot[VARYING_SLOT_BFC1];
|
||||
|
||||
if (slot == -1) {
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ typedef enum
|
|||
* - vertResults (in prog_print.c's arb_output_attrib_string())
|
||||
* - fragAttribs (in prog_print.c's arb_input_attrib_string())
|
||||
* - _mesa_varying_slot_in_fs()
|
||||
* - _mesa_frag_attrib_to_vert_result()
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -287,9 +286,7 @@ typedef enum
|
|||
/*********************************************/
|
||||
|
||||
/**
|
||||
* Indexes for fragment program input attributes. Note that
|
||||
* _mesa_frag_attrib_to_vert_result() makes assumptions about the layout of
|
||||
* this enum.
|
||||
* Indexes for fragment program input attributes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -334,27 +331,6 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert from a gl_frag_attrib value to the corresponding gl_varying_slot
|
||||
* for a vertex output.
|
||||
*
|
||||
* gl_frag_attrib values which have no corresponding vertex output
|
||||
* (FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC) are converted to a value of -1.
|
||||
*/
|
||||
static inline int
|
||||
_mesa_frag_attrib_to_vert_result(gl_frag_attrib frag_attrib)
|
||||
{
|
||||
if (frag_attrib <= FRAG_ATTRIB_TEX7)
|
||||
return frag_attrib;
|
||||
else if (frag_attrib < FRAG_ATTRIB_CLIP_DIST0)
|
||||
return -1;
|
||||
else if (frag_attrib <= FRAG_ATTRIB_CLIP_DIST1)
|
||||
return frag_attrib;
|
||||
else /* frag_attrib >= FRAG_ATTRIB_VAR0 */
|
||||
return frag_attrib;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Bitflags for fragment program input attributes.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue