📄 prog_instruction.h
字号:
MAX_OPCODE} gl_inst_opcode;/** * Instruction source register. */struct prog_src_register{ GLuint File:4; /**< One of the PROGRAM_* register file values. */ GLint Index:9; /**< May be negative for relative addressing. */ GLuint Swizzle:12; GLuint RelAddr:1; /** * \name Source register "sign" control. * * The ARB and NV extensions allow varrying degrees of control over the * sign of the source vector components. These values allow enough control * for all flavors of the extensions. */ /*@{*/ /** * Per-component negation for the SWZ instruction. For non-SWZ * instructions the only possible values are NEGATE_XYZW and NEGATE_NONE. * * \since * ARB_vertex_program, ARB_fragment_program */ GLuint NegateBase:4; /** * Take the component-wise absolute value. * * \since * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, * NV_vertex_program2_option. */ GLuint Abs:1; /** * Post-absolute value negation (all components). */ GLuint NegateAbs:1; /*@}*/};/** * Instruction destination register. */struct prog_dst_register{ /** * One of the PROGRAM_* register file values. */ GLuint File:4; GLuint Index:8; GLuint WriteMask:4; /** * \name Conditional destination update control. * * \since * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, * NV_vertex_program2_option. */ /*@{*/ /** * Takes one of the 9 possible condition values (EQ, FL, GT, GE, LE, LT, * NE, TR, or UN). Dest reg is only written to if the matching * (swizzled) condition code value passes. When a conditional update mask * is not specified, this will be \c COND_TR. */ GLuint CondMask:4; /** * Condition code swizzle value. */ GLuint CondSwizzle:12; /** * Selects the condition code register to use for conditional destination * update masking. In NV_fragmnet_program or NV_vertex_program2 mode, only * condition code register 0 is available. In NV_vertex_program3 mode, * condition code registers 0 and 1 are available. */ GLuint CondSrc:1; /*@}*/ GLuint pad:31;};/** * Vertex/fragment program instruction. */struct prog_instruction{ gl_inst_opcode Opcode;#if FEATURE_MESA_program_debug GLshort StringPos;#endif /** * Arbitrary data. Used for the PRINT, CAL, and BRA instructions. */ void *Data; struct prog_src_register SrcReg[3]; struct prog_dst_register DstReg; /** * Indicates that the instruction should update the condition code * register. * * \since * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, * NV_vertex_program2_option. */ GLuint CondUpdate:1; /** * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the * condition code register that is to be updated. * * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition * code register 0 is available. In GL_NV_vertex_program3 mode, condition * code registers 0 and 1 are available. * * \since * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2, * NV_vertex_program2_option. */ GLuint CondDst:1; /** * Saturate each value of the vectored result to the range [0,1] or the * range [-1,1]. \c SSAT mode (i.e., saturation to the range [-1,1]) is * only available in NV_fragment_program2 mode. * Value is one of the SATURATE_* tokens. * * \since * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3. */ GLuint SaturateMode:2; /** * Per-instruction selectable precision. * * \since * NV_fragment_program, NV_fragment_program_option. */ GLuint Precision:3; /** * \name Texture source controls. * * The texture source controls are only used with the \c TEX, \c TXD, * \c TXL, and \c TXP instructions. * * \since * ARB_fragment_program, NV_fragment_program, NV_vertex_program3. */ /*@{*/ /** * Source texture unit. OpenGL supports a maximum of 32 texture * units. */ GLuint TexSrcUnit:5; /** * Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX. */ GLuint TexSrcTarget:3; /*@}*/ /** * For BRA and CAL instructions, the location to jump to. * For BGNLOOP, points to ENDLOOP (and vice-versa). * For BRK, points to BGNLOOP (which points to ENDLOOP). * For IF, points to else or endif. * For ELSE, points to endif. */ GLint BranchTarget; /** * For TEX instructions in shaders, the sampler to use for the * texture lookup. */ GLint Sampler; const char *Comment;};extern void_mesa_init_instructions(struct prog_instruction *inst, GLuint count);extern struct prog_instruction *_mesa_alloc_instructions(GLuint numInst);extern struct prog_instruction *_mesa_realloc_instructions(struct prog_instruction *oldInst, GLuint numOldInst, GLuint numNewInst);extern struct prog_instruction *_mesa_copy_instructions(struct prog_instruction *dest, const struct prog_instruction *src, GLuint n);extern void_mesa_free_instructions(struct prog_instruction *inst, GLuint count);extern GLuint_mesa_num_inst_src_regs(gl_inst_opcode opcode);extern GLuint_mesa_num_inst_dst_regs(gl_inst_opcode opcode);extern GLboolean_mesa_is_tex_instruction(gl_inst_opcode opcode);extern const char *_mesa_opcode_string(gl_inst_opcode opcode);#endif /* PROG_INSTRUCTION_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -