mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
c/render: Better names for descriptor sets [NFC]
This commit is contained in:
parent
50adb87d79
commit
7441a9bda6
|
@ -154,7 +154,7 @@ update_compute_layer_descriptor_set(struct vk_bundle *vk,
|
|||
}
|
||||
|
||||
XRT_MAYBE_UNUSED static void
|
||||
update_compute_distortion_descriptor_set(struct vk_bundle *vk,
|
||||
update_compute_shared_descriptor_set(struct vk_bundle *vk,
|
||||
uint32_t src_binding,
|
||||
VkSampler src_samplers[2],
|
||||
VkImageView src_image_views[2],
|
||||
|
@ -334,13 +334,13 @@ render_compute_init(struct render_compute *crc, struct render_resources *r)
|
|||
vk, //
|
||||
r->compute.descriptor_pool, // descriptor_pool
|
||||
r->compute.layer.descriptor_set_layout, // descriptor_set_layout
|
||||
&crc->descriptor_set)); // descriptor_set
|
||||
&crc->layer_descriptor_set)); // descriptor_set
|
||||
|
||||
C(vk_create_descriptor_set( //
|
||||
vk, //
|
||||
r->compute.descriptor_pool, // descriptor_pool
|
||||
r->compute.distortion.descriptor_set_layout, // descriptor_set_layout
|
||||
&crc->distortion_descriptor_set)); // descriptor_set
|
||||
&crc->shared_descriptor_set)); // descriptor_set
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -400,8 +400,8 @@ render_compute_close(struct render_compute *crc)
|
|||
struct vk_bundle *vk = vk_from_crc(crc);
|
||||
|
||||
// Reclaimed by vkResetDescriptorPool.
|
||||
crc->descriptor_set = VK_NULL_HANDLE;
|
||||
crc->distortion_descriptor_set = VK_NULL_HANDLE;
|
||||
crc->layer_descriptor_set = VK_NULL_HANDLE;
|
||||
crc->shared_descriptor_set = VK_NULL_HANDLE;
|
||||
|
||||
vk->vkResetDescriptorPool(vk->device, crc->r->compute.descriptor_pool, 0);
|
||||
|
||||
|
@ -459,7 +459,7 @@ render_compute_layers(struct render_compute *crc,
|
|||
r->compute.ubo_binding, //
|
||||
r->compute.layer.ubo.buffer, //
|
||||
VK_WHOLE_SIZE, //
|
||||
crc->descriptor_set); //
|
||||
crc->layer_descriptor_set); //
|
||||
|
||||
vk->vkCmdBindPipeline( //
|
||||
crc->r->cmd, // commandBuffer
|
||||
|
@ -472,7 +472,7 @@ render_compute_layers(struct render_compute *crc,
|
|||
r->compute.layer.pipeline_layout, // layout
|
||||
0, // firstSet
|
||||
1, // descriptorSetCount
|
||||
&crc->descriptor_set, // pDescriptorSets
|
||||
&crc->layer_descriptor_set, // pDescriptorSets
|
||||
0, // dynamicOffsetCount
|
||||
NULL); // pDynamicOffsets
|
||||
|
||||
|
@ -585,7 +585,7 @@ render_compute_projection_timewarp(struct render_compute *crc,
|
|||
sampler, sampler, sampler, sampler, sampler, sampler,
|
||||
};
|
||||
|
||||
update_compute_distortion_descriptor_set( //
|
||||
update_compute_shared_descriptor_set( //
|
||||
vk, //
|
||||
r->compute.src_binding, //
|
||||
src_samplers, //
|
||||
|
@ -598,7 +598,7 @@ render_compute_projection_timewarp(struct render_compute *crc,
|
|||
r->compute.ubo_binding, //
|
||||
r->compute.distortion.ubo.buffer, //
|
||||
VK_WHOLE_SIZE, //
|
||||
crc->distortion_descriptor_set); //
|
||||
crc->shared_descriptor_set); //
|
||||
|
||||
vk->vkCmdBindPipeline( //
|
||||
r->cmd, // commandBuffer
|
||||
|
@ -611,7 +611,7 @@ render_compute_projection_timewarp(struct render_compute *crc,
|
|||
r->compute.distortion.pipeline_layout, // layout
|
||||
0, // firstSet
|
||||
1, // descriptorSetCount
|
||||
&crc->distortion_descriptor_set, // pDescriptorSets
|
||||
&crc->shared_descriptor_set, // pDescriptorSets
|
||||
0, // dynamicOffsetCount
|
||||
NULL); // pDynamicOffsets
|
||||
|
||||
|
@ -705,7 +705,7 @@ render_compute_projection(struct render_compute *crc,
|
|||
sampler, sampler, sampler, sampler, sampler, sampler,
|
||||
};
|
||||
|
||||
update_compute_distortion_descriptor_set( //
|
||||
update_compute_shared_descriptor_set( //
|
||||
vk, //
|
||||
r->compute.src_binding, //
|
||||
src_samplers, //
|
||||
|
@ -718,7 +718,7 @@ render_compute_projection(struct render_compute *crc,
|
|||
r->compute.ubo_binding, //
|
||||
r->compute.distortion.ubo.buffer, //
|
||||
VK_WHOLE_SIZE, //
|
||||
crc->distortion_descriptor_set); //
|
||||
crc->shared_descriptor_set); //
|
||||
|
||||
vk->vkCmdBindPipeline( //
|
||||
r->cmd, // commandBuffer
|
||||
|
@ -731,7 +731,7 @@ render_compute_projection(struct render_compute *crc,
|
|||
r->compute.distortion.pipeline_layout, // layout
|
||||
0, // firstSet
|
||||
1, // descriptorSetCount
|
||||
&crc->distortion_descriptor_set, // pDescriptorSets
|
||||
&crc->shared_descriptor_set, // pDescriptorSets
|
||||
0, // dynamicOffsetCount
|
||||
NULL); // pDynamicOffsets
|
||||
|
||||
|
@ -826,7 +826,7 @@ render_compute_clear(struct render_compute *crc, //
|
|||
VkImageView src_image_views[2] = {r->mock.color.image_view, r->mock.color.image_view};
|
||||
VkSampler distortion_samplers[6] = {sampler, sampler, sampler, sampler, sampler, sampler};
|
||||
|
||||
update_compute_distortion_descriptor_set( //
|
||||
update_compute_shared_descriptor_set( //
|
||||
vk, // vk_bundle
|
||||
r->compute.src_binding, // src_binding
|
||||
src_samplers, // src_samplers[2]
|
||||
|
@ -839,7 +839,7 @@ render_compute_clear(struct render_compute *crc, //
|
|||
r->compute.ubo_binding, // ubo_binding
|
||||
r->compute.clear.ubo.buffer, // ubo_buffer
|
||||
VK_WHOLE_SIZE, // ubo_size
|
||||
crc->distortion_descriptor_set); // descriptor_set
|
||||
crc->shared_descriptor_set); // descriptor_set
|
||||
|
||||
vk->vkCmdBindPipeline( //
|
||||
r->cmd, // commandBuffer
|
||||
|
@ -852,7 +852,7 @@ render_compute_clear(struct render_compute *crc, //
|
|||
r->compute.distortion.pipeline_layout, // layout
|
||||
0, // firstSet
|
||||
1, // descriptorSetCount
|
||||
&crc->distortion_descriptor_set, // pDescriptorSets
|
||||
&crc->shared_descriptor_set, // pDescriptorSets
|
||||
0, // dynamicOffsetCount
|
||||
NULL); // pDynamicOffsets
|
||||
|
||||
|
|
|
@ -735,11 +735,15 @@ struct render_compute
|
|||
//! Shared resources.
|
||||
struct render_resources *r;
|
||||
|
||||
//! Shared descriptor set between clear, projection and timewarp.
|
||||
VkDescriptorSet descriptor_set;
|
||||
//! Layer descriptor set.
|
||||
VkDescriptorSet layer_descriptor_set;
|
||||
|
||||
//! Descriptor set for distortion.
|
||||
VkDescriptorSet distortion_descriptor_set;
|
||||
/*!
|
||||
* Shared descriptor set, used for the clear and distortion shaders. It
|
||||
* is used in the functions @ref render_compute_projection_timewarp,
|
||||
* @ref render_compute_projection and @ref render_compute_clear.
|
||||
*/
|
||||
VkDescriptorSet shared_descriptor_set;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in a new issue