Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //:ES2_AA2_MAC_DEB: My debug macro, true if positive.
- //: pix_err: PIXel ERRor ( Stores Hex Error Code )
- //: pix_fra: PIXel FRAgment ( fragment color )
- #if( ES2_AA2_MAC_DEB > 0 ) //:///////////////////////////://
- //:ASSIGN_TO_ZERO_AT_TOP_OF_FUNCTION!!!!!!!!!!!!!!!!!!!!
- uint pix_err =( 0x00000000 );
- #endif //:///////////////////////////////////////////////://
- //: ...Later when you want to error check....
- #if( ES2_AA2_MAC_DEB > 0 ) //:///////////////////////////://
- if( Ax1-Ax0+uint(1) != ES2_zoo_wid ||
- Ay1-Ay0+uint(1) != ES2_zoo_hig ){
- //: The first error encountered puts program ://
- //: into invalid state, so we want to make sure ://
- //: we never override the first error tripped. ://
- //: So always guard with comparison to ://
- //: 0x00000000 before setting to the error color.://
- if( uint(0x00000000) == pix_err ){
- pix_err=( uint(0xFF9000FF) );
- };;
- };;
- #endif //:///////////////////////////////////////////////://
- ... Do more code.......................................
- ... DONT TRY TO EXIT EARLY if error is tripped ........
- ... that will just turn your code into spaghetti ......
- #if( ES2_AA2_MAC_DEB > 0 ) //://////////////////////////://
- if( uint(0x000000) != pix_err ){
- #define F_F uint(0xFF)" //://////////////////////://
- pix_fra=( vec4( //://///////////////////////////://
- float( ( pix_err >> 24 ) & F_F ) / 255.0
- ,float( ( pix_err >> 16 ) & F_F ) / 255.0
- ,float( ( pix_err >> 8 ) & F_F ) / 255.0
- ,float( ( pix_err >> 0 ) & F_F ) / 255.0
- ));; //://///////////////////////////////////////://
- #undef F_F //://////////////////////////////////://
- };;
- #endif //:///////////////////////////////////////////////://
- //: Now in debug mode, you can color sample the pixel ://
- //: and type in the hex code to find the exact error. ://
- //: Might not be helpful for minor edge cases, but ://
- //: should be very helpful for gross mistakes in ://
- //: your programming logic. ://
- return( pix_fra );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement