radv/meta: add a helper to create btoi r32g32b32 pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30248>
This commit is contained in:
@@ -332,11 +332,22 @@ build_nir_btoi_r32g32b32_compute_shader(struct radv_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VkResult
|
static VkResult
|
||||||
radv_device_init_meta_btoi_r32g32b32_state(struct radv_device *device)
|
create_btoi_r32g32b32_pipeline(struct radv_device *device, VkPipeline *pipeline)
|
||||||
{
|
{
|
||||||
VkResult result;
|
VkResult result;
|
||||||
nir_shader *cs = build_nir_btoi_r32g32b32_compute_shader(device);
|
nir_shader *cs = build_nir_btoi_r32g32b32_compute_shader(device);
|
||||||
|
|
||||||
|
result = radv_meta_create_compute_pipeline(device, cs, device->meta_state.btoi_r32g32b32.img_p_layout, pipeline);
|
||||||
|
|
||||||
|
ralloc_free(cs);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static VkResult
|
||||||
|
radv_device_init_meta_btoi_r32g32b32_state(struct radv_device *device)
|
||||||
|
{
|
||||||
|
VkResult result;
|
||||||
|
|
||||||
const VkDescriptorSetLayoutBinding bindings[] = {
|
const VkDescriptorSetLayoutBinding bindings[] = {
|
||||||
{
|
{
|
||||||
.binding = 0,
|
.binding = 0,
|
||||||
@@ -355,7 +366,7 @@ radv_device_init_meta_btoi_r32g32b32_state(struct radv_device *device)
|
|||||||
result =
|
result =
|
||||||
radv_meta_create_descriptor_set_layout(device, 2, bindings, &device->meta_state.btoi_r32g32b32.img_ds_layout);
|
radv_meta_create_descriptor_set_layout(device, 2, bindings, &device->meta_state.btoi_r32g32b32.img_ds_layout);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
goto fail;
|
return result;
|
||||||
|
|
||||||
const VkPushConstantRange pc_range = {
|
const VkPushConstantRange pc_range = {
|
||||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
@@ -365,14 +376,9 @@ radv_device_init_meta_btoi_r32g32b32_state(struct radv_device *device)
|
|||||||
result = radv_meta_create_pipeline_layout(device, &device->meta_state.btoi_r32g32b32.img_ds_layout, 1, &pc_range,
|
result = radv_meta_create_pipeline_layout(device, &device->meta_state.btoi_r32g32b32.img_ds_layout, 1, &pc_range,
|
||||||
&device->meta_state.btoi_r32g32b32.img_p_layout);
|
&device->meta_state.btoi_r32g32b32.img_p_layout);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
goto fail;
|
return result;
|
||||||
|
|
||||||
result = radv_meta_create_compute_pipeline(device, cs, device->meta_state.btoi_r32g32b32.img_p_layout,
|
return create_btoi_r32g32b32_pipeline(device, &device->meta_state.btoi_r32g32b32.pipeline);
|
||||||
&device->meta_state.btoi_r32g32b32.pipeline);
|
|
||||||
|
|
||||||
fail:
|
|
||||||
ralloc_free(cs);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user