radv: Move resolve NIR fs to radv_meta_nir.c

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33494>
This commit is contained in:
Timur Kristóf 2025-02-11 14:06:08 +01:00 committed by Marge Bot
parent b360474821
commit c093b03213
3 changed files with 18 additions and 18 deletions

View file

@ -342,6 +342,8 @@ nir_shader *radv_meta_nir_build_depth_stencil_resolve_fragment_shader(struct rad
enum radv_meta_resolve_type index,
VkResolveModeFlagBits resolve_mode);
nir_shader *radv_meta_nir_build_resolve_fs(struct radv_device *dev);
uint32_t radv_fill_buffer(struct radv_cmd_buffer *cmd_buffer, const struct radv_image *image,
struct radeon_winsys_bo *bo, uint64_t va, uint64_t size, uint32_t value);

View file

@ -7,27 +7,10 @@
#include <assert.h>
#include <stdbool.h>
#include "nir/nir_builder.h"
#include "radv_entrypoints.h"
#include "radv_meta.h"
#include "sid.h"
#include "vk_format.h"
static nir_shader *
build_nir_fs(struct radv_device *dev)
{
const struct glsl_type *vec4 = glsl_vec4_type();
nir_variable *f_color;
nir_builder b = radv_meta_init_shader(dev, MESA_SHADER_FRAGMENT, "meta_resolve_fs");
f_color = nir_variable_create(b.shader, nir_var_shader_out, vec4, "f_color");
f_color->data.location = FRAG_RESULT_DATA0;
nir_store_var(&b, f_color, nir_imm_vec4(&b, 0.0, 0.0, 0.0, 1.0), 0xf);
return b.shader;
}
struct radv_resolve_key {
enum radv_meta_object_key_type type;
uint32_t fs_key;
@ -55,7 +38,7 @@ get_pipeline(struct radv_device *device, unsigned fs_key, VkPipeline *pipeline_o
}
nir_shader *vs_module = radv_meta_build_nir_vs_generate_vertices(device);
nir_shader *fs_module = build_nir_fs(device);
nir_shader *fs_module = radv_meta_nir_build_resolve_fs(device);
const VkGraphicsPipelineCreateInfoRADV radv_info = {
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO_RADV,

View file

@ -1386,3 +1386,18 @@ radv_meta_nir_build_depth_stencil_resolve_fragment_shader(struct radv_device *de
return b.shader;
}
nir_shader *
radv_meta_nir_build_resolve_fs(struct radv_device *dev)
{
const struct glsl_type *vec4 = glsl_vec4_type();
nir_variable *f_color;
nir_builder b = radv_meta_init_shader(dev, MESA_SHADER_FRAGMENT, "meta_resolve_fs");
f_color = nir_variable_create(b.shader, nir_var_shader_out, vec4, "f_color");
f_color->data.location = FRAG_RESULT_DATA0;
nir_store_var(&b, f_color, nir_imm_vec4(&b, 0.0, 0.0, 0.0, 1.0), 0xf);
return b.shader;
}