c/render: Change argument order to object first

This commit is contained in:
Jakob Bornecrantz 2021-11-02 12:46:40 +00:00
parent ccc4bbcf86
commit 648f49f4ef
5 changed files with 10 additions and 10 deletions

View file

@ -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

View file

@ -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];

View file

@ -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);

View file

@ -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.

View file

@ -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);