radv: update VK_KHR_depth_stencil_resolve for Vulkan 1.2
Promoted to Vulkan 1.2 with the KHR suffix omitted. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:

committed by
Jason Ekstrand

parent
5993f13b27
commit
b537be4368
@@ -1615,9 +1615,9 @@ void radv_GetPhysicalDeviceProperties2(
|
|||||||
properties->variableSampleLocations = false;
|
properties->variableSampleLocations = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
|
||||||
VkPhysicalDeviceDepthStencilResolvePropertiesKHR *properties =
|
VkPhysicalDeviceDepthStencilResolveProperties *properties =
|
||||||
(VkPhysicalDeviceDepthStencilResolvePropertiesKHR *)ext;
|
(VkPhysicalDeviceDepthStencilResolveProperties *)ext;
|
||||||
|
|
||||||
/* We support all of the depth resolve modes */
|
/* We support all of the depth resolve modes */
|
||||||
properties->supportedDepthResolveModes =
|
properties->supportedDepthResolveModes =
|
||||||
|
@@ -146,7 +146,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
|
get_resolve_mode_str(VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
switch (resolve_mode) {
|
switch (resolve_mode) {
|
||||||
case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
|
case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
|
||||||
@@ -165,7 +165,7 @@ get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
|
|||||||
static nir_shader *
|
static nir_shader *
|
||||||
build_depth_stencil_resolve_compute_shader(struct radv_device *dev, int samples,
|
build_depth_stencil_resolve_compute_shader(struct radv_device *dev, int samples,
|
||||||
int index,
|
int index,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
nir_builder b;
|
nir_builder b;
|
||||||
char name[64];
|
char name[64];
|
||||||
@@ -413,7 +413,7 @@ static VkResult
|
|||||||
create_depth_stencil_resolve_pipeline(struct radv_device *device,
|
create_depth_stencil_resolve_pipeline(struct radv_device *device,
|
||||||
int samples,
|
int samples,
|
||||||
int index,
|
int index,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode,
|
VkResolveModeFlagBits resolve_mode,
|
||||||
VkPipeline *pipeline)
|
VkPipeline *pipeline)
|
||||||
{
|
{
|
||||||
VkResult result;
|
VkResult result;
|
||||||
@@ -707,7 +707,7 @@ emit_depth_stencil_resolve(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
const VkOffset2D *dest_offset,
|
const VkOffset2D *dest_offset,
|
||||||
const VkExtent2D *resolve_extent,
|
const VkExtent2D *resolve_extent,
|
||||||
VkImageAspectFlags aspects,
|
VkImageAspectFlags aspects,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
struct radv_device *device = cmd_buffer->device;
|
struct radv_device *device = cmd_buffer->device;
|
||||||
const uint32_t samples = src_iview->image->info.samples;
|
const uint32_t samples = src_iview->image->info.samples;
|
||||||
@@ -961,7 +961,7 @@ radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer)
|
|||||||
void
|
void
|
||||||
radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
|
radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
VkImageAspectFlags aspects,
|
VkImageAspectFlags aspects,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
|
struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
|
||||||
const struct radv_subpass *subpass = cmd_buffer->state.subpass;
|
const struct radv_subpass *subpass = cmd_buffer->state.subpass;
|
||||||
|
@@ -318,7 +318,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
|
get_resolve_mode_str(VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
switch (resolve_mode) {
|
switch (resolve_mode) {
|
||||||
case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
|
case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
|
||||||
@@ -337,7 +337,7 @@ get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
|
|||||||
static nir_shader *
|
static nir_shader *
|
||||||
build_depth_stencil_resolve_fragment_shader(struct radv_device *dev, int samples,
|
build_depth_stencil_resolve_fragment_shader(struct radv_device *dev, int samples,
|
||||||
int index,
|
int index,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
nir_builder b;
|
nir_builder b;
|
||||||
char name[64];
|
char name[64];
|
||||||
@@ -454,7 +454,7 @@ static VkResult
|
|||||||
create_depth_stencil_resolve_pipeline(struct radv_device *device,
|
create_depth_stencil_resolve_pipeline(struct radv_device *device,
|
||||||
int samples_log2,
|
int samples_log2,
|
||||||
int index,
|
int index,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
VkRenderPass *render_pass;
|
VkRenderPass *render_pass;
|
||||||
VkPipeline *pipeline;
|
VkPipeline *pipeline;
|
||||||
@@ -885,7 +885,7 @@ emit_depth_stencil_resolve(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
const VkOffset2D *dst_offset,
|
const VkOffset2D *dst_offset,
|
||||||
const VkExtent2D *resolve_extent,
|
const VkExtent2D *resolve_extent,
|
||||||
VkImageAspectFlags aspects,
|
VkImageAspectFlags aspects,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
struct radv_device *device = cmd_buffer->device;
|
struct radv_device *device = cmd_buffer->device;
|
||||||
const uint32_t samples = src_iview->image->info.samples;
|
const uint32_t samples = src_iview->image->info.samples;
|
||||||
@@ -1181,7 +1181,7 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer)
|
|||||||
void
|
void
|
||||||
radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
|
radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
VkImageAspectFlags aspects,
|
VkImageAspectFlags aspects,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode)
|
VkResolveModeFlagBits resolve_mode)
|
||||||
{
|
{
|
||||||
struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
|
struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
|
||||||
const struct radv_subpass *subpass = cmd_buffer->state.subpass;
|
const struct radv_subpass *subpass = cmd_buffer->state.subpass;
|
||||||
|
@@ -338,9 +338,9 @@ VkResult radv_CreateRenderPass(
|
|||||||
static unsigned
|
static unsigned
|
||||||
radv_num_subpass_attachments2(const VkSubpassDescription2 *desc)
|
radv_num_subpass_attachments2(const VkSubpassDescription2 *desc)
|
||||||
{
|
{
|
||||||
const VkSubpassDescriptionDepthStencilResolveKHR *ds_resolve =
|
const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
|
||||||
vk_find_struct_const(desc->pNext,
|
vk_find_struct_const(desc->pNext,
|
||||||
SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);
|
SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);
|
||||||
|
|
||||||
return desc->inputAttachmentCount +
|
return desc->inputAttachmentCount +
|
||||||
desc->colorAttachmentCount +
|
desc->colorAttachmentCount +
|
||||||
@@ -487,9 +487,9 @@ VkResult radv_CreateRenderPass2(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const VkSubpassDescriptionDepthStencilResolveKHR *ds_resolve =
|
const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
|
||||||
vk_find_struct_const(desc->pNext,
|
vk_find_struct_const(desc->pNext,
|
||||||
SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);
|
SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);
|
||||||
|
|
||||||
if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment) {
|
if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment) {
|
||||||
subpass->ds_resolve_attachment = p++;
|
subpass->ds_resolve_attachment = p++;
|
||||||
|
@@ -1422,11 +1422,11 @@ void radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer);
|
|||||||
void radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer);
|
void radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer);
|
||||||
void radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
|
void radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
VkImageAspectFlags aspects,
|
VkImageAspectFlags aspects,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode);
|
VkResolveModeFlagBits resolve_mode);
|
||||||
void radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer);
|
void radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer);
|
||||||
void radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
|
void radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
VkImageAspectFlags aspects,
|
VkImageAspectFlags aspects,
|
||||||
VkResolveModeFlagBitsKHR resolve_mode);
|
VkResolveModeFlagBits resolve_mode);
|
||||||
void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples);
|
void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples);
|
||||||
unsigned radv_get_default_max_sample_dist(int log_samples);
|
unsigned radv_get_default_max_sample_dist(int log_samples);
|
||||||
void radv_device_init_msaa(struct radv_device *device);
|
void radv_device_init_msaa(struct radv_device *device);
|
||||||
@@ -2155,8 +2155,8 @@ struct radv_subpass {
|
|||||||
struct radv_subpass_attachment * resolve_attachments;
|
struct radv_subpass_attachment * resolve_attachments;
|
||||||
struct radv_subpass_attachment * depth_stencil_attachment;
|
struct radv_subpass_attachment * depth_stencil_attachment;
|
||||||
struct radv_subpass_attachment * ds_resolve_attachment;
|
struct radv_subpass_attachment * ds_resolve_attachment;
|
||||||
VkResolveModeFlagBitsKHR depth_resolve_mode;
|
VkResolveModeFlagBits depth_resolve_mode;
|
||||||
VkResolveModeFlagBitsKHR stencil_resolve_mode;
|
VkResolveModeFlagBits stencil_resolve_mode;
|
||||||
|
|
||||||
/** Subpass has at least one color resolve attachment */
|
/** Subpass has at least one color resolve attachment */
|
||||||
bool has_color_resolve;
|
bool has_color_resolve;
|
||||||
|
Reference in New Issue
Block a user