summaryrefslogtreecommitdiff
path: root/src/modules/ray
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-09-15 19:52:49 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-09-15 19:52:49 -0700
commit337440d4a0f141c036e057ecc4fe4f4b808ff9c0 (patch)
tree10c4050ad018832eca5060ef479a1abe9fc16048 /src/modules/ray
parent37edf85c87a8a71eb00c205d8c97eebd6c8dcd25 (diff)
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.
Diffstat (limited to 'src/modules/ray')
-rw-r--r--src/modules/ray/ray_scene.c3
1 files changed, 1 insertions, 2 deletions
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));
}
© All Rights Reserved