From 337440d4a0f141c036e057ecc4fe4f4b808ff9c0 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 15 Sep 2017 19:52:49 -0700 Subject: modules/*: cease dividing stride by 4 Just cast buf to (void *) for the pointer arithmetic, stride is in units of bytes and no assumptions should be made about its value such as divisability by 4. --- src/modules/ray/ray_scene.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/modules/ray') diff --git a/src/modules/ray/ray_scene.c b/src/modules/ray/ray_scene.c index 91249f3..f78ed3e 100644 --- a/src/modules/ray/ray_scene.c +++ b/src/modules/ray/ray_scene.c @@ -190,7 +190,6 @@ static inline ray_color_t trace_ray(ray_scene_t *scene, ray_ray_t *primary_ray) void ray_scene_render_fragment(ray_scene_t *scene, fb_fragment_t *fb_fragment) { - unsigned stride = fb_fragment->stride / 4; uint32_t *buf = fb_fragment->buf; ray_camera_fragment_t fragment; ray_ray_t ray; @@ -202,7 +201,7 @@ void ray_scene_render_fragment(ray_scene_t *scene, fb_fragment_t *fb_fragment) buf++; } while (ray_camera_fragment_x_step(&fragment)); - buf += stride; + buf = ((void *)buf) + fb_fragment->stride; } while (ray_camera_fragment_y_step(&fragment)); } -- cgit v1.2.1