false,
false,
GLSL_TYPE_FLOAT);
- const struct glsl_type *img_type = glsl_sampler_type(GLSL_SAMPLER_DIM_2D,
- false,
- false,
- GLSL_TYPE_FLOAT);
+ const struct glsl_type *img_type = glsl_image_type(GLSL_SAMPLER_DIM_2D,
+ false,
+ GLSL_TYPE_FLOAT);
snprintf(name, 64, "meta_resolve_cs-%d-%s", samples, is_integer ? "int" : (is_srgb ? "srgb" : "float"));
nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_COMPUTE, NULL);
b.shader->info.name = ralloc_strdup(b.shader, name);
output_img->data.descriptor_set = 0;
output_img->data.binding = 1;
nir_ssa_def *invoc_id = nir_load_local_invocation_id(&b);
- nir_ssa_def *wg_id = nir_load_work_group_id(&b);
+ nir_ssa_def *wg_id = nir_load_work_group_id(&b, 32);
nir_ssa_def *block_size = nir_imm_ivec4(&b,
b.shader->info.cs.local_size[0],
b.shader->info.cs.local_size[1],
store->src[1] = nir_src_for_ssa(coord);
store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
store->src[3] = nir_src_for_ssa(outval);
+ store->src[4] = nir_src_for_ssa(nir_imm_int(&b, 0));
nir_builder_instr_insert(&b, &store->instr);
return b.shader;
}
};
static const char *
-get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
+get_resolve_mode_str(VkResolveModeFlagBits resolve_mode)
{
switch (resolve_mode) {
case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
static nir_shader *
build_depth_stencil_resolve_compute_shader(struct radv_device *dev, int samples,
int index,
- VkResolveModeFlagBitsKHR resolve_mode)
+ VkResolveModeFlagBits resolve_mode)
{
nir_builder b;
char name[64];
false,
false,
GLSL_TYPE_FLOAT);
- const struct glsl_type *img_type = glsl_sampler_type(GLSL_SAMPLER_DIM_2D,
- false,
- false,
- GLSL_TYPE_FLOAT);
+ const struct glsl_type *img_type = glsl_image_type(GLSL_SAMPLER_DIM_2D,
+ false,
+ GLSL_TYPE_FLOAT);
snprintf(name, 64, "meta_resolve_cs_%s-%s-%d",
index == DEPTH_RESOLVE ? "depth" : "stencil",
get_resolve_mode_str(resolve_mode), samples);
output_img->data.descriptor_set = 0;
output_img->data.binding = 1;
nir_ssa_def *invoc_id = nir_load_local_invocation_id(&b);
- nir_ssa_def *wg_id = nir_load_work_group_id(&b);
+ nir_ssa_def *wg_id = nir_load_work_group_id(&b, 32);
nir_ssa_def *block_size = nir_imm_ivec4(&b,
b.shader->info.cs.local_size[0],
b.shader->info.cs.local_size[1],
store->src[1] = nir_src_for_ssa(coord);
store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
store->src[3] = nir_src_for_ssa(outval);
+ store->src[4] = nir_src_for_ssa(nir_imm_int(&b, 0));
nir_builder_instr_insert(&b, &store->instr);
return b.shader;
}
create_depth_stencil_resolve_pipeline(struct radv_device *device,
int samples,
int index,
- VkResolveModeFlagBitsKHR resolve_mode,
+ VkResolveModeFlagBits resolve_mode,
VkPipeline *pipeline)
{
VkResult result;
const VkOffset2D *dest_offset,
const VkExtent2D *resolve_extent,
VkImageAspectFlags aspects,
- VkResolveModeFlagBitsKHR resolve_mode)
+ VkResolveModeFlagBits resolve_mode)
{
struct radv_device *device = cmd_buffer->device;
const uint32_t samples = src_iview->image->info.samples;
.baseArrayLayer = src_base_layer + layer,
.layerCount = 1,
},
- });
+ }, NULL);
struct radv_image_view dest_iview;
radv_image_view_init(&dest_iview, cmd_buffer->device,
.baseArrayLayer = dest_base_layer + layer,
.layerCount = 1,
},
- });
+ }, NULL);
emit_resolve(cmd_buffer,
&src_iview,
if (dst_att.attachment == VK_ATTACHMENT_UNUSED)
continue;
- struct radv_image_view *src_iview = fb->attachments[src_att.attachment];
- struct radv_image_view *dst_iview = fb->attachments[dst_att.attachment];
+ struct radv_image_view *src_iview = cmd_buffer->state.attachments[src_att.attachment].iview;
+ struct radv_image_view *dst_iview = cmd_buffer->state.attachments[dst_att.attachment].iview;
VkImageResolve region = {
.extent = (VkExtent3D){ fb->width, fb->height, 0 },
void
radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
VkImageAspectFlags aspects,
- VkResolveModeFlagBitsKHR resolve_mode)
+ VkResolveModeFlagBits resolve_mode)
{
struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
const struct radv_subpass *subpass = cmd_buffer->state.subpass;
struct radv_subpass_attachment dest_att = *subpass->ds_resolve_attachment;
struct radv_image_view *src_iview =
- cmd_buffer->state.framebuffer->attachments[src_att.attachment];
+ cmd_buffer->state.attachments[src_att.attachment].iview;
struct radv_image_view *dst_iview =
- cmd_buffer->state.framebuffer->attachments[dest_att.attachment];
+ cmd_buffer->state.attachments[dest_att.attachment].iview;
struct radv_image *src_image = src_iview->image;
struct radv_image *dst_image = dst_iview->image;
.baseArrayLayer = src_iview->base_layer + layer,
.layerCount = 1,
},
- });
+ }, NULL);
struct radv_image_view tdst_iview;
radv_image_view_init(&tdst_iview, cmd_buffer->device,
.baseArrayLayer = dst_iview->base_layer + layer,
.layerCount = 1,
},
- });
+ }, NULL);
emit_depth_stencil_resolve(cmd_buffer, &tsrc_iview, &tdst_iview,
&(VkOffset2D) { 0, 0 },
if (radv_image_has_htile(dst_image)) {
if (aspects == VK_IMAGE_ASPECT_DEPTH_BIT) {
VkImageSubresourceRange range = {};
- range.aspectMask = aspects;
+ range.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
range.baseMipLevel = dst_iview->base_mip;
range.levelCount = 1;
range.baseArrayLayer = dst_iview->base_layer;