Go to the source code of this file.
Functions | |
unsigned | brw_count_bits (unsigned val) |
unsigned | brw_translate_blend_factor (int factor) |
unsigned | brw_translate_blend_equation (int mode) |
unsigned brw_count_bits | ( | unsigned | val | ) |
Definition at line 38 of file brw_util.c.
00039 { 00040 unsigned i; 00041 for (i = 0; val ; val >>= 1) 00042 if (val & 1) 00043 i++; 00044 return i; 00045 }
unsigned brw_translate_blend_equation | ( | int | mode | ) |
Definition at line 48 of file brw_util.c.
References assert, BRW_BLENDFUNCTION_ADD, BRW_BLENDFUNCTION_MAX, BRW_BLENDFUNCTION_MIN, BRW_BLENDFUNCTION_REVERSE_SUBTRACT, BRW_BLENDFUNCTION_SUBTRACT, PIPE_BLEND_ADD, PIPE_BLEND_MAX, PIPE_BLEND_MIN, PIPE_BLEND_REVERSE_SUBTRACT, and PIPE_BLEND_SUBTRACT.
00049 { 00050 switch (mode) { 00051 case PIPE_BLEND_ADD: 00052 return BRW_BLENDFUNCTION_ADD; 00053 case PIPE_BLEND_MIN: 00054 return BRW_BLENDFUNCTION_MIN; 00055 case PIPE_BLEND_MAX: 00056 return BRW_BLENDFUNCTION_MAX; 00057 case PIPE_BLEND_SUBTRACT: 00058 return BRW_BLENDFUNCTION_SUBTRACT; 00059 case PIPE_BLEND_REVERSE_SUBTRACT: 00060 return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; 00061 default: 00062 assert(0); 00063 return BRW_BLENDFUNCTION_ADD; 00064 } 00065 }
unsigned brw_translate_blend_factor | ( | int | factor | ) |
Definition at line 67 of file brw_util.c.
References assert, BRW_BLENDFACTOR_CONST_ALPHA, BRW_BLENDFACTOR_CONST_COLOR, BRW_BLENDFACTOR_DST_ALPHA, BRW_BLENDFACTOR_DST_COLOR, BRW_BLENDFACTOR_INV_CONST_ALPHA, BRW_BLENDFACTOR_INV_CONST_COLOR, BRW_BLENDFACTOR_INV_DST_ALPHA, BRW_BLENDFACTOR_INV_DST_COLOR, BRW_BLENDFACTOR_INV_SRC_ALPHA, BRW_BLENDFACTOR_INV_SRC_COLOR, BRW_BLENDFACTOR_ONE, BRW_BLENDFACTOR_SRC_ALPHA, BRW_BLENDFACTOR_SRC_ALPHA_SATURATE, BRW_BLENDFACTOR_SRC_COLOR, BRW_BLENDFACTOR_ZERO, PIPE_BLENDFACTOR_CONST_ALPHA, PIPE_BLENDFACTOR_CONST_COLOR, PIPE_BLENDFACTOR_DST_ALPHA, PIPE_BLENDFACTOR_DST_COLOR, PIPE_BLENDFACTOR_INV_CONST_ALPHA, PIPE_BLENDFACTOR_INV_CONST_COLOR, PIPE_BLENDFACTOR_INV_DST_ALPHA, PIPE_BLENDFACTOR_INV_DST_COLOR, PIPE_BLENDFACTOR_INV_SRC_ALPHA, PIPE_BLENDFACTOR_INV_SRC_COLOR, PIPE_BLENDFACTOR_ONE, PIPE_BLENDFACTOR_SRC_ALPHA, PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE, PIPE_BLENDFACTOR_SRC_COLOR, and PIPE_BLENDFACTOR_ZERO.
00068 { 00069 switch(factor) { 00070 case PIPE_BLENDFACTOR_ZERO: 00071 return BRW_BLENDFACTOR_ZERO; 00072 case PIPE_BLENDFACTOR_SRC_ALPHA: 00073 return BRW_BLENDFACTOR_SRC_ALPHA; 00074 case PIPE_BLENDFACTOR_ONE: 00075 return BRW_BLENDFACTOR_ONE; 00076 case PIPE_BLENDFACTOR_SRC_COLOR: 00077 return BRW_BLENDFACTOR_SRC_COLOR; 00078 case PIPE_BLENDFACTOR_INV_SRC_COLOR: 00079 return BRW_BLENDFACTOR_INV_SRC_COLOR; 00080 case PIPE_BLENDFACTOR_DST_COLOR: 00081 return BRW_BLENDFACTOR_DST_COLOR; 00082 case PIPE_BLENDFACTOR_INV_DST_COLOR: 00083 return BRW_BLENDFACTOR_INV_DST_COLOR; 00084 case PIPE_BLENDFACTOR_INV_SRC_ALPHA: 00085 return BRW_BLENDFACTOR_INV_SRC_ALPHA; 00086 case PIPE_BLENDFACTOR_DST_ALPHA: 00087 return BRW_BLENDFACTOR_DST_ALPHA; 00088 case PIPE_BLENDFACTOR_INV_DST_ALPHA: 00089 return BRW_BLENDFACTOR_INV_DST_ALPHA; 00090 case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: 00091 return BRW_BLENDFACTOR_SRC_ALPHA_SATURATE; 00092 case PIPE_BLENDFACTOR_CONST_COLOR: 00093 return BRW_BLENDFACTOR_CONST_COLOR; 00094 case PIPE_BLENDFACTOR_INV_CONST_COLOR: 00095 return BRW_BLENDFACTOR_INV_CONST_COLOR; 00096 case PIPE_BLENDFACTOR_CONST_ALPHA: 00097 return BRW_BLENDFACTOR_CONST_ALPHA; 00098 case PIPE_BLENDFACTOR_INV_CONST_ALPHA: 00099 return BRW_BLENDFACTOR_INV_CONST_ALPHA; 00100 default: 00101 assert(0); 00102 return BRW_BLENDFACTOR_ZERO; 00103 } 00104 }