@@ -1177,7 +1177,7 @@ static inline void sw_float_to_unorm8_simd(uint8_t dst[4], const float src[4])
11771177static inline void sw_float_from_unorm8_simd (float dst [4 ], const uint8_t src [4 ])
11781178{
11791179#if defined(SW_HAS_NEON )
1180- uint8x8_t bytes8 = vld1_u8 (src ); //< Read 8 bytes, faster, but let's hope we're not at the end of the page (unlikely)...
1180+ uint8x8_t bytes8 = vld1_u8 (src ); // Reading 8 bytes, faster, but let's hope not hitting the end of the page (unlikely)...
11811181 uint16x8_t bytes16 = vmovl_u8 (bytes8 );
11821182 uint32x4_t ints = vmovl_u16 (vget_low_u16 (bytes16 ));
11831183 float32x4_t floats = vcvtq_f32_u32 (ints );
@@ -1224,8 +1224,8 @@ static inline uint32_t sw_half_to_float_ui(uint16_t h)
12241224 // denormal: flush to zero
12251225 r = (em < (1 << 10 ))? 0 : r ;
12261226
1227- // infinity/NaN; note that we preserve NaN payload as a byproduct of unifying inf/nan cases
1228- // 112 is an exponent bias fixup; since we already applied it once, applying it twice converts 31 to 255
1227+ // NOTE: infinity/NaN; NaN payload is preserved as a byproduct of unifying inf/nan cases
1228+ // 112 is an exponent bias fixup; since it is already applied once, applying it twice converts 31 to 255
12291229 r += (em >= (31 << 10 ))? (112 << 23 ) : 0 ;
12301230
12311231 return s | r ;
@@ -1252,7 +1252,7 @@ static inline uint16_t sw_half_from_float_ui(uint32_t ui)
12521252 // Overflow: infinity; 143 encodes exponent 16
12531253 h = (em >= (143 << 23 ))? 0x7c00 : h ;
12541254
1255- // NaN; note that we convert all types of NaN to qNaN
1255+ // NOTE: NaN; all types of NaN aree converted to qNaN
12561256 h = (em > (255 << 23 ))? 0x7e00 : h ;
12571257
12581258 return (uint16_t )(s | h );
@@ -1918,8 +1918,8 @@ static inline void sw_texture_sample_nearest(float *color, const sw_texture_t *t
19181918
19191919static inline void sw_texture_sample_linear (float * color , const sw_texture_t * tex , float u , float v )
19201920{
1921- // TODO: With a bit more cleverness we could clearly reduce the
1922- // number of operations here , but for now it works fine
1921+ // TODO: With a bit more cleverness thee number of operations can
1922+ // be clearly reduced , but for now it works fine
19231923
19241924 float xf = (u * tex -> width ) - 0.5f ;
19251925 float yf = (v * tex -> height ) - 0.5f ;
@@ -1933,7 +1933,7 @@ static inline void sw_texture_sample_linear(float *color, const sw_texture_t *te
19331933 int x1 = x0 + 1 ;
19341934 int y1 = y0 + 1 ;
19351935
1936- // NOTE: If the textures are POT we could avoid the division for SW_REPEAT
1936+ // NOTE: If the textures are POT, avoid the division for SW_REPEAT
19371937
19381938 if (tex -> sWrap == SW_CLAMP )
19391939 {
@@ -1974,7 +1974,7 @@ static inline void sw_texture_sample_linear(float *color, const sw_texture_t *te
19741974static inline void sw_texture_sample (float * color , const sw_texture_t * tex , float u , float v , float dUdx , float dUdy , float dVdx , float dVdy )
19751975{
19761976 // Previous method: There is no need to compute the square root
1977- // because using the squared value, the comparison remains ` L2 > 1.0f*1.0f`
1977+ // because using the squared value, the comparison remains ( L2 > 1.0f*1.0f)
19781978 //float du = sqrtf(dUdx*dUdx + dUdy*dUdy);
19791979 //float dv = sqrtf(dVdx*dVdx + dVdy*dVdy);
19801980 //float L = (du > dv)? du : dv;
@@ -2204,12 +2204,12 @@ static inline bool sw_polygon_clip(sw_vertex_t polygon[SW_MAX_CLIPPED_POLYGON_VE
22042204static inline bool sw_triangle_face_culling (void )
22052205{
22062206 // NOTE: Face culling is done before clipping to avoid unnecessary computations
2207- // To handle triangles crossing the w=0 plane correctly,
2208- // we perform the winding order test in homogeneous coordinates directly,
2209- // before the perspective division (division by w)
2210- // This test determines the orientation of the triangle in the (x,y,w) plane,
2211- // which corresponds to the projected 2D winding order sign,
2212- // even with negative w values
2207+ // To handle triangles crossing the w=0 plane correctly,
2208+ // the winding order test is performeed in homogeneous coordinates directly,
2209+ // before the perspective division (division by w)
2210+ // This test determines the orientation of the triangle in the (x,y,w) plane,
2211+ // which corresponds to the projected 2D winding order sign,
2212+ // even with negative w values
22132213
22142214 // Preload homogeneous coordinates into local variables
22152215 const float * h0 = RLSW .vertexBuffer [0 ].homogeneous ;
@@ -2558,13 +2558,13 @@ static inline void sw_triangle_render(void)
25582558static inline bool sw_quad_face_culling (void )
25592559{
25602560 // NOTE: Face culling is done before clipping to avoid unnecessary computations
2561- // To handle quads crossing the w=0 plane correctly,
2562- // we perform the winding order test in homogeneous coordinates directly,
2563- // before the perspective division (division by w)
2564- // For a convex quad with vertices P0, P1, P2, P3 in sequential order,
2565- // the winding order of the quad is the same as the winding order
2566- // of the triangle P0 P1 P2. We use the homogeneous triangle
2567- // winding test on this first triangle
2561+ // To handle quads crossing the w=0 plane correctly,
2562+ // the winding order test is performed in homogeneous coordinates directly,
2563+ // before the perspective division (division by w)
2564+ // For a convex quad with vertices P0, P1, P2, P3 in sequential order,
2565+ // the winding order of the quad is the same as the winding order
2566+ // of the triangle P0 P1 P2. The homogeneous triangle is used on
2567+ // winding test on this first triangle
25682568
25692569 // Preload homogeneous coordinates into local variables
25702570 const float * h0 = RLSW .vertexBuffer [0 ].homogeneous ;
@@ -2649,7 +2649,7 @@ static inline bool sw_quad_is_axis_aligned(void)
26492649{
26502650 // Reject quads with perspective projection
26512651 // The fast path assumes affine (non-perspective) quads,
2652- // so we require all vertices to have homogeneous w = 1.0
2652+ // so it's required for all vertices to have homogeneous w = 1.0
26532653 for (int i = 0 ; i < 4 ; i ++ )
26542654 {
26552655 if (RLSW .vertexBuffer [i ].homogeneous [3 ] != 1.0f ) return false;
@@ -2721,7 +2721,7 @@ static inline void sw_quad_sort_cw(const sw_vertex_t* *output)
27212721
27222722// TODO: REVIEW: Could a perfectly aligned quad, where one of the four points has a different depth,
27232723// still appear perfectly aligned from a certain point of view?
2724- // Because in that case, we would still need to perform perspective division for textures and colors...
2724+ // Because in that case, it's still needed to perform perspective division for textures and colors...
27252725#define DEFINE_QUAD_RASTER_AXIS_ALIGNED (FUNC_NAME , ENABLE_TEXTURE , ENABLE_DEPTH_TEST , ENABLE_COLOR_BLEND ) \
27262726static inline void FUNC_NAME(void) \
27272727{ \
@@ -3090,7 +3090,7 @@ static inline void FUNC_NAME(const sw_vertex_t *v0, const sw_vertex_t *v1) \
30903090 \
30913091 for (int i = 0 ; i < numPixels ; i ++ ) \
30923092 { \
3093- /* REVIEW: May require reviewing projection details */ \
3093+ /* TODO: REVIEW: May require reviewing projection details */ \
30943094 int px = (int )(x - 0.5f ); \
30953095 int py = (int )(y - 0.5f ); \
30963096 \
@@ -3721,7 +3721,7 @@ void swBlitFramebuffer(int xDst, int yDst, int wDst, int hDst, int xSrc, int ySr
37213721 ySrc = sw_clampi (ySrc , 0 , hSrc );
37223722
37233723 // Check if the sizes are identical after clamping the source to avoid unexpected issues
3724- // REVIEW: This repeats the operations if true, so we could make a copy function without these checks
3724+ // TODO: REVIEW: This repeats the operations if true, so a copy function can be made without these checks
37253725 if (xDst == xSrc && yDst == ySrc && wDst == wSrc && hDst == hSrc )
37263726 {
37273727 swCopyFramebuffer (xSrc , ySrc , wSrc , hSrc , format , type , pixels );
0 commit comments