diff --git a/src/amd/vulkan/meta/radv_meta.h b/src/amd/vulkan/meta/radv_meta.h index 8a748d31688..66880f778cd 100644 --- a/src/amd/vulkan/meta/radv_meta.h +++ b/src/amd/vulkan/meta/radv_meta.h @@ -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); diff --git a/src/amd/vulkan/meta/radv_meta_resolve.c b/src/amd/vulkan/meta/radv_meta_resolve.c index 6149570663a..d3dff9d07b1 100644 --- a/src/amd/vulkan/meta/radv_meta_resolve.c +++ b/src/amd/vulkan/meta/radv_meta_resolve.c @@ -7,27 +7,10 @@ #include #include -#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, diff --git a/src/amd/vulkan/nir/radv_meta_nir.c b/src/amd/vulkan/nir/radv_meta_nir.c index 6d8f30811ee..0c746976842 100644 --- a/src/amd/vulkan/nir/radv_meta_nir.c +++ b/src/amd/vulkan/nir/radv_meta_nir.c @@ -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; +}