📄 gglassembler.h
字号:
int8_t size; };private: struct tex_coord_t { reg_t s; reg_t t; pointer_t ptr; }; struct fragment_parts_t { uint32_t packed : 1; uint32_t reload : 2; uint32_t iterated_packed : 1; pixel_t iterated; pointer_t cbPtr; pointer_t covPtr; reg_t count; reg_t argb[4]; reg_t argb_dx[4]; reg_t z; reg_t dither; pixel_t texel[GGL_TEXTURE_UNIT_COUNT]; tex_coord_t coords[GGL_TEXTURE_UNIT_COUNT]; }; struct texture_unit_t { int format_idx; GGLFormat format; int bits; int swrap; int twrap; int env; int pot; int linear; uint8_t mask; uint8_t replaced; }; struct texture_machine_t { texture_unit_t tmu[GGL_TEXTURE_UNIT_COUNT]; uint8_t mask; uint8_t replaced; uint8_t directTexture; uint8_t activeUnits; }; struct component_info_t { bool masked : 1; bool inDest : 1; bool needed : 1; bool replaced : 1; bool iterated : 1; bool smooth : 1; bool blend : 1; bool fog : 1; }; struct builder_context_t { context_t const* c; needs_t needs; int Rctx; }; template <typename T> void modify(T& r, Scratch& regs) { if (!(r.flags & CORRUPTIBLE)) { r.reg = regs.obtain(); r.flags |= CORRUPTIBLE; } } // helpers void base_offset(const pointer_t& d, const pointer_t& b, const reg_t& o); // texture environement void modulate( component_t& dest, const component_t& incoming, const pixel_t& texel, int component); void decal( component_t& dest, const component_t& incoming, const pixel_t& texel, int component); void blend( component_t& dest, const component_t& incoming, const pixel_t& texel, int component, int tmu); // load/store stuff void store(const pointer_t& addr, const pixel_t& src, uint32_t flags=0); void load(const pointer_t& addr, const pixel_t& dest, uint32_t flags=0); void extract(integer_t& d, const pixel_t& s, int component); void extract(component_t& d, const pixel_t& s, int component); void extract(integer_t& d, int s, int h, int l, int bits=32); void expand(integer_t& d, const integer_t& s, int dbits); void expand(integer_t& d, const component_t& s, int dbits); void expand(component_t& d, const component_t& s, int dbits); void downshift(pixel_t& d, int component, component_t s, const reg_t& dither); void mul_factor( component_t& d, const integer_t& v, const integer_t& f); void mul_factor_add( component_t& d, const integer_t& v, const integer_t& f, const component_t& a); void component_add( component_t& d, const integer_t& dst, const integer_t& src); void component_sat( const component_t& v); void build_scanline_prolog( fragment_parts_t& parts, const needs_t& needs); void build_smooth_shade(const fragment_parts_t& parts); void build_component( pixel_t& pixel, const fragment_parts_t& parts, int component, Scratch& global_scratches); void build_incoming_component( component_t& temp, int dst_size, const fragment_parts_t& parts, int component, Scratch& scratches, Scratch& global_scratches); void init_iterated_color(fragment_parts_t& parts, const reg_t& x); void build_iterated_color( component_t& fragment, const fragment_parts_t& parts, int component, Scratch& regs); void decodeLogicOpNeeds(const needs_t& needs); void decodeTMUNeeds(const needs_t& needs, context_t const* c); void init_textures( tex_coord_t* coords, const reg_t& x, const reg_t& y); void build_textures( fragment_parts_t& parts, Scratch& regs); void filter8( const fragment_parts_t& parts, pixel_t& texel, const texture_unit_t& tmu, int U, int V, pointer_t& txPtr, int FRAC_BITS); void filter16( const fragment_parts_t& parts, pixel_t& texel, const texture_unit_t& tmu, int U, int V, pointer_t& txPtr, int FRAC_BITS); void filter24( const fragment_parts_t& parts, pixel_t& texel, const texture_unit_t& tmu, int U, int V, pointer_t& txPtr, int FRAC_BITS); void filter32( const fragment_parts_t& parts, pixel_t& texel, const texture_unit_t& tmu, int U, int V, pointer_t& txPtr, int FRAC_BITS); void build_texture_environment( component_t& fragment, const fragment_parts_t& parts, int component, Scratch& regs); void wrapping( int d, int coord, int size, int tx_wrap, int tx_linear); void build_fog( component_t& temp, int component, Scratch& parent_scratches); void build_blending( component_t& in_out, const pixel_t& pixel, int component, Scratch& parent_scratches); void build_blend_factor( integer_t& factor, int f, int component, const pixel_t& dst_pixel, integer_t& fragment, integer_t& fb, Scratch& scratches); void build_blendFOneMinusF( component_t& temp, const integer_t& factor, const integer_t& fragment, const integer_t& fb); void build_blendOneMinusFF( component_t& temp, const integer_t& factor, const integer_t& fragment, const integer_t& fb); void build_coverage_application(component_t& fragment, const fragment_parts_t& parts, Scratch& regs); void build_alpha_test(component_t& fragment, const fragment_parts_t& parts); enum { Z_TEST=1, Z_WRITE=2 }; void build_depth_test(const fragment_parts_t& parts, uint32_t mask); void build_iterate_z(const fragment_parts_t& parts); void build_iterate_f(const fragment_parts_t& parts); void build_iterate_texture_coordinates(const fragment_parts_t& parts); void build_logic_op(pixel_t& pixel, Scratch& regs); void build_masking(pixel_t& pixel, Scratch& regs); void build_and_immediate(int d, int s, uint32_t mask, int bits); bool isAlphaSourceNeeded() const; enum { FACTOR_SRC=1, FACTOR_DST=2, BLEND_SRC=4, BLEND_DST=8 }; enum { LOGIC_OP=1, LOGIC_OP_SRC=2, LOGIC_OP_DST=4 }; static int blending_codes(int fs, int fd); builder_context_t mBuilderContext; texture_machine_t mTextureMachine; component_info_t mInfo[4]; int mBlending; int mMasking; int mLogicOp; int mAlphaTest; int mAA; int mDithering; int mDepthTest; int mSmooth; int mFog; pixel_t mDstPixel; GGLFormat mCbFormat; int mBlendFactorCached; integer_t mAlphaSource; int mBaseRegister; int mBlendSrc; int mBlendDst; int mBlendSrcA; int mBlendDstA; int mOptLevel;};// ----------------------------------------------------------------------------}; // namespace android#endif // ANDROID_GGLASSEMBLER_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -