From 648f49f4efecb12337497e0f44fa27501aafd58b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 2 Nov 2021 12:46:40 +0000 Subject: [PATCH] c/render: Change argument order to object first --- src/xrt/compositor/main/comp_compositor.c | 4 ++-- src/xrt/compositor/main/comp_renderer.c | 2 +- src/xrt/compositor/render/comp_compute.c | 2 +- src/xrt/compositor/render/comp_render.h | 6 +++--- src/xrt/compositor/render/comp_shaders.c | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c index 2fbb8e467..bc3b35117 100644 --- a/src/xrt/compositor/main/comp_compositor.c +++ b/src/xrt/compositor/main/comp_compositor.c @@ -583,7 +583,7 @@ compositor_destroy(struct xrt_compositor *xc) comp_resources_close(&c->nr, c); // As long as vk_bundle is valid it's safe to call this function. - comp_shaders_close(vk, &c->shaders); + comp_shaders_close(&c->shaders, vk); // Does NULL checking. comp_target_destroy(&c->target); @@ -1362,7 +1362,7 @@ compositor_init_shaders(struct comp_compositor *c) { struct vk_bundle *vk = &c->vk; - return comp_shaders_load(vk, &c->shaders); + return comp_shaders_load(&c->shaders, vk); } static bool diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c index 7ecf86706..563ef7e27 100644 --- a/src/xrt/compositor/main/comp_renderer.c +++ b/src/xrt/compositor/main/comp_renderer.c @@ -982,7 +982,7 @@ dispatch_compute(struct comp_renderer *r, struct comp_rendering_compute *crc) struct comp_compositor *c = r->c; struct comp_target *ct = c->target; - comp_rendering_compute_init(c, &c->nr, crc); + comp_rendering_compute_init(crc, c, &c->nr); comp_rendering_compute_begin(crc); struct comp_viewport_data views[2]; diff --git a/src/xrt/compositor/render/comp_compute.c b/src/xrt/compositor/render/comp_compute.c index 6fbf1469e..2c12bb11d 100644 --- a/src/xrt/compositor/render/comp_compute.c +++ b/src/xrt/compositor/render/comp_compute.c @@ -360,7 +360,7 @@ update_compute_discriptor_set_target(struct vk_bundle *vk, */ bool -comp_rendering_compute_init(struct comp_compositor *c, struct comp_resources *r, struct comp_rendering_compute *crc) +comp_rendering_compute_init(struct comp_rendering_compute *crc, struct comp_compositor *c, struct comp_resources *r) { assert(crc->c == NULL); assert(crc->r == NULL); diff --git a/src/xrt/compositor/render/comp_render.h b/src/xrt/compositor/render/comp_render.h index a37637ed8..fba77b230 100644 --- a/src/xrt/compositor/render/comp_render.h +++ b/src/xrt/compositor/render/comp_render.h @@ -91,13 +91,13 @@ struct comp_shaders * Loads all of the shaders that the compositor uses. */ bool -comp_shaders_load(struct vk_bundle *vk, struct comp_shaders *s); +comp_shaders_load(struct comp_shaders *s, struct vk_bundle *vk); /*! * Unload and cleanup shaders. */ void -comp_shaders_close(struct vk_bundle *vk, struct comp_shaders *s); +comp_shaders_close(struct comp_shaders *s, struct vk_bundle *vk); /* @@ -561,7 +561,7 @@ struct comp_ubo_compute_data * Init struct and create resources needed for compute rendering. */ bool -comp_rendering_compute_init(struct comp_compositor *c, struct comp_resources *r, struct comp_rendering_compute *crc); +comp_rendering_compute_init(struct comp_rendering_compute *crc, struct comp_compositor *c, struct comp_resources *r); /*! * Frees all resources held by the compute rendering, does not free the struct itself. diff --git a/src/xrt/compositor/render/comp_shaders.c b/src/xrt/compositor/render/comp_shaders.c index ad8429d55..70f4a441d 100644 --- a/src/xrt/compositor/render/comp_shaders.c +++ b/src/xrt/compositor/render/comp_shaders.c @@ -73,13 +73,13 @@ shader_load(struct vk_bundle *vk, const uint32_t *code, size_t size, VkShaderMod do { \ VkResult ret = c; \ if (ret != VK_SUCCESS) { \ - comp_shaders_close(vk, s); \ + comp_shaders_close(s, vk); \ return false; \ } \ } while (false) bool -comp_shaders_load(struct vk_bundle *vk, struct comp_shaders *s) +comp_shaders_load(struct comp_shaders *s, struct vk_bundle *vk) { C(shader_load(vk, // vk_bundle shaders_clear_comp, // data @@ -144,7 +144,7 @@ comp_shaders_load(struct vk_bundle *vk, struct comp_shaders *s) } void -comp_shaders_close(struct vk_bundle *vk, struct comp_shaders *s) +comp_shaders_close(struct comp_shaders *s, struct vk_bundle *vk) { D(clear_comp); D(distortion_comp);