i915_state_inlines.h File Reference

Include dependency graph for i915_state_inlines.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static unsigned i915_translate_compare_func (unsigned func)
static unsigned i915_translate_stencil_op (unsigned op)
static unsigned i915_translate_blend_factor (unsigned factor)
static unsigned i915_translate_blend_func (unsigned mode)
static unsigned i915_translate_logic_op (unsigned opcode)
static boolean i915_validate_vertices (unsigned hw_prim, unsigned nr)


Function Documentation

static unsigned i915_translate_blend_factor ( unsigned  factor  )  [static]

Definition at line 87 of file i915_state_inlines.h.

References BLENDFACT_CONST_ALPHA, BLENDFACT_CONST_COLOR, BLENDFACT_DST_ALPHA, BLENDFACT_DST_COLR, BLENDFACT_INV_CONST_ALPHA, BLENDFACT_INV_CONST_COLOR, BLENDFACT_INV_DST_ALPHA, BLENDFACT_INV_DST_COLR, BLENDFACT_INV_SRC_ALPHA, BLENDFACT_INV_SRC_COLR, BLENDFACT_ONE, BLENDFACT_SRC_ALPHA, BLENDFACT_SRC_ALPHA_SATURATE, BLENDFACT_SRC_COLR, BLENDFACT_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.

00088 {
00089    switch (factor) {
00090    case PIPE_BLENDFACTOR_ZERO:
00091       return BLENDFACT_ZERO;
00092    case PIPE_BLENDFACTOR_SRC_ALPHA:
00093       return BLENDFACT_SRC_ALPHA;
00094    case PIPE_BLENDFACTOR_ONE:
00095       return BLENDFACT_ONE;
00096    case PIPE_BLENDFACTOR_SRC_COLOR:
00097       return BLENDFACT_SRC_COLR;
00098    case PIPE_BLENDFACTOR_INV_SRC_COLOR:
00099       return BLENDFACT_INV_SRC_COLR;
00100    case PIPE_BLENDFACTOR_DST_COLOR:
00101       return BLENDFACT_DST_COLR;
00102    case PIPE_BLENDFACTOR_INV_DST_COLOR:
00103       return BLENDFACT_INV_DST_COLR;
00104    case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
00105       return BLENDFACT_INV_SRC_ALPHA;
00106    case PIPE_BLENDFACTOR_DST_ALPHA:
00107       return BLENDFACT_DST_ALPHA;
00108    case PIPE_BLENDFACTOR_INV_DST_ALPHA:
00109       return BLENDFACT_INV_DST_ALPHA;
00110    case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
00111       return BLENDFACT_SRC_ALPHA_SATURATE;
00112    case PIPE_BLENDFACTOR_CONST_COLOR:
00113       return BLENDFACT_CONST_COLOR;
00114    case PIPE_BLENDFACTOR_INV_CONST_COLOR:
00115       return BLENDFACT_INV_CONST_COLOR;
00116    case PIPE_BLENDFACTOR_CONST_ALPHA:
00117       return BLENDFACT_CONST_ALPHA;
00118    case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
00119       return BLENDFACT_INV_CONST_ALPHA;
00120    default:
00121       return BLENDFACT_ZERO;
00122    }
00123 }

static unsigned i915_translate_blend_func ( unsigned  mode  )  [static]

Definition at line 126 of file i915_state_inlines.h.

References BLENDFUNC_ADD, BLENDFUNC_MAX, BLENDFUNC_MIN, BLENDFUNC_REVERSE_SUBTRACT, BLENDFUNC_SUBTRACT, PIPE_BLEND_ADD, PIPE_BLEND_MAX, PIPE_BLEND_MIN, PIPE_BLEND_REVERSE_SUBTRACT, and PIPE_BLEND_SUBTRACT.

00127 {
00128    switch (mode) {
00129    case PIPE_BLEND_ADD:
00130       return BLENDFUNC_ADD;
00131    case PIPE_BLEND_MIN:
00132       return BLENDFUNC_MIN;
00133    case PIPE_BLEND_MAX:
00134       return BLENDFUNC_MAX;
00135    case PIPE_BLEND_SUBTRACT:
00136       return BLENDFUNC_SUBTRACT;
00137    case PIPE_BLEND_REVERSE_SUBTRACT:
00138       return BLENDFUNC_REVERSE_SUBTRACT;
00139    default:
00140       return 0;
00141    }
00142 }

static unsigned i915_translate_compare_func ( unsigned  func  )  [static]

Definition at line 37 of file i915_state_inlines.h.

References COMPAREFUNC_ALWAYS, COMPAREFUNC_EQUAL, COMPAREFUNC_GEQUAL, COMPAREFUNC_GREATER, COMPAREFUNC_LEQUAL, COMPAREFUNC_LESS, COMPAREFUNC_NEVER, COMPAREFUNC_NOTEQUAL, PIPE_FUNC_ALWAYS, PIPE_FUNC_EQUAL, PIPE_FUNC_GEQUAL, PIPE_FUNC_GREATER, PIPE_FUNC_LEQUAL, PIPE_FUNC_LESS, PIPE_FUNC_NEVER, and PIPE_FUNC_NOTEQUAL.

00038 {
00039    switch (func) {
00040    case PIPE_FUNC_NEVER:
00041       return COMPAREFUNC_NEVER;
00042    case PIPE_FUNC_LESS:
00043       return COMPAREFUNC_LESS;
00044    case PIPE_FUNC_LEQUAL:
00045       return COMPAREFUNC_LEQUAL;
00046    case PIPE_FUNC_GREATER:
00047       return COMPAREFUNC_GREATER;
00048    case PIPE_FUNC_GEQUAL:
00049       return COMPAREFUNC_GEQUAL;
00050    case PIPE_FUNC_NOTEQUAL:
00051       return COMPAREFUNC_NOTEQUAL;
00052    case PIPE_FUNC_EQUAL:
00053       return COMPAREFUNC_EQUAL;
00054    case PIPE_FUNC_ALWAYS:
00055       return COMPAREFUNC_ALWAYS;
00056    default:
00057       return COMPAREFUNC_ALWAYS;
00058    }
00059 }

static unsigned i915_translate_logic_op ( unsigned  opcode  )  [static]

Definition at line 146 of file i915_state_inlines.h.

References LOGICOP_AND, LOGICOP_AND_INV, LOGICOP_AND_RVRSE, LOGICOP_CLEAR, LOGICOP_COPY, LOGICOP_COPY_INV, LOGICOP_EQUIV, LOGICOP_INV, LOGICOP_NAND, LOGICOP_NOOP, LOGICOP_NOR, LOGICOP_OR, LOGICOP_OR_INV, LOGICOP_OR_RVRSE, LOGICOP_SET, LOGICOP_XOR, PIPE_LOGICOP_AND, PIPE_LOGICOP_AND_INVERTED, PIPE_LOGICOP_AND_REVERSE, PIPE_LOGICOP_CLEAR, PIPE_LOGICOP_COPY, PIPE_LOGICOP_COPY_INVERTED, PIPE_LOGICOP_EQUIV, PIPE_LOGICOP_INVERT, PIPE_LOGICOP_NAND, PIPE_LOGICOP_NOOP, PIPE_LOGICOP_NOR, PIPE_LOGICOP_OR, PIPE_LOGICOP_OR_INVERTED, PIPE_LOGICOP_OR_REVERSE, PIPE_LOGICOP_SET, and PIPE_LOGICOP_XOR.

00147 {
00148    switch (opcode) {
00149    case PIPE_LOGICOP_CLEAR:
00150       return LOGICOP_CLEAR;
00151    case PIPE_LOGICOP_AND:
00152       return LOGICOP_AND;
00153    case PIPE_LOGICOP_AND_REVERSE:
00154       return LOGICOP_AND_RVRSE;
00155    case PIPE_LOGICOP_COPY:
00156       return LOGICOP_COPY;
00157    case PIPE_LOGICOP_COPY_INVERTED:
00158       return LOGICOP_COPY_INV;
00159    case PIPE_LOGICOP_AND_INVERTED:
00160       return LOGICOP_AND_INV;
00161    case PIPE_LOGICOP_NOOP:
00162       return LOGICOP_NOOP;
00163    case PIPE_LOGICOP_XOR:
00164       return LOGICOP_XOR;
00165    case PIPE_LOGICOP_OR:
00166       return LOGICOP_OR;
00167    case PIPE_LOGICOP_OR_INVERTED:
00168       return LOGICOP_OR_INV;
00169    case PIPE_LOGICOP_NOR:
00170       return LOGICOP_NOR;
00171    case PIPE_LOGICOP_EQUIV:
00172       return LOGICOP_EQUIV;
00173    case PIPE_LOGICOP_INVERT:
00174       return LOGICOP_INV;
00175    case PIPE_LOGICOP_OR_REVERSE:
00176       return LOGICOP_OR_RVRSE;
00177    case PIPE_LOGICOP_NAND:
00178       return LOGICOP_NAND;
00179    case PIPE_LOGICOP_SET:
00180       return LOGICOP_SET;
00181    default:
00182       return LOGICOP_SET;
00183    }
00184 }

static unsigned i915_translate_stencil_op ( unsigned  op  )  [static]

Definition at line 62 of file i915_state_inlines.h.

References PIPE_STENCIL_OP_DECR, PIPE_STENCIL_OP_DECR_WRAP, PIPE_STENCIL_OP_INCR, PIPE_STENCIL_OP_INCR_WRAP, PIPE_STENCIL_OP_INVERT, PIPE_STENCIL_OP_KEEP, PIPE_STENCIL_OP_REPLACE, PIPE_STENCIL_OP_ZERO, STENCILOP_DECR, STENCILOP_DECRSAT, STENCILOP_INCR, STENCILOP_INCRSAT, STENCILOP_INVERT, STENCILOP_KEEP, STENCILOP_REPLACE, and STENCILOP_ZERO.

00063 {
00064    switch (op) {
00065    case PIPE_STENCIL_OP_KEEP:
00066       return STENCILOP_KEEP;
00067    case PIPE_STENCIL_OP_ZERO:
00068       return STENCILOP_ZERO;
00069    case PIPE_STENCIL_OP_REPLACE:
00070       return STENCILOP_REPLACE;
00071    case PIPE_STENCIL_OP_INCR:
00072       return STENCILOP_INCRSAT;
00073    case PIPE_STENCIL_OP_DECR:
00074       return STENCILOP_DECRSAT;
00075    case PIPE_STENCIL_OP_INCR_WRAP:
00076       return STENCILOP_INCR;
00077    case PIPE_STENCIL_OP_DECR_WRAP:
00078       return STENCILOP_DECR;
00079    case PIPE_STENCIL_OP_INVERT:
00080       return STENCILOP_INVERT;
00081    default:
00082       return STENCILOP_ZERO;
00083    }
00084 }

static boolean i915_validate_vertices ( unsigned  hw_prim,
unsigned  nr 
) [static]

Definition at line 188 of file i915_state_inlines.h.

References assert, PRIM3D_LINELIST, PRIM3D_LINESTRIP, PRIM3D_POINTLIST, PRIM3D_POLY, PRIM3D_TRIFAN, PRIM3D_TRILIST, and PRIM3D_TRISTRIP.

00189 {
00190    boolean ok;
00191 
00192    switch (hw_prim) {
00193    case PRIM3D_POINTLIST:
00194       ok = (nr >= 1);
00195       assert(ok);
00196       break;
00197    case PRIM3D_LINELIST:
00198       ok = (nr >= 2) && (nr % 2) == 0;
00199       assert(ok);
00200       break;
00201    case PRIM3D_LINESTRIP:
00202       ok = (nr >= 2);
00203       assert(ok);
00204       break;
00205    case PRIM3D_TRILIST:
00206       ok = (nr >= 3) && (nr % 3) == 0;
00207       assert(ok);
00208       break;
00209    case PRIM3D_TRISTRIP:
00210       ok = (nr >= 3);
00211       assert(ok);
00212       break;
00213    case PRIM3D_TRIFAN:
00214       ok = (nr >= 3);
00215       assert(ok);
00216       break;
00217    case PRIM3D_POLY:
00218       ok = (nr >= 3);
00219       assert(ok);
00220       break;
00221    default:
00222       assert(0);
00223       ok = 0;
00224       break;
00225    }
00226 
00227    return ok;
00228 }


Generated on Tue Sep 29 06:25:35 2009 for Gallium3D by  doxygen 1.5.4