radv: select the depth decompress path based on the aspect mask
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -330,14 +330,25 @@ cleanup:
|
|||||||
|
|
||||||
static VkPipeline *
|
static VkPipeline *
|
||||||
radv_get_depth_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
radv_get_depth_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
||||||
struct radv_image *image, enum radv_depth_op op)
|
struct radv_image *image,
|
||||||
|
const VkImageSubresourceRange *subresourceRange,
|
||||||
|
enum radv_depth_op op)
|
||||||
{
|
{
|
||||||
struct radv_meta_state *state = &cmd_buffer->device->meta_state;
|
struct radv_meta_state *state = &cmd_buffer->device->meta_state;
|
||||||
uint32_t samples = image->info.samples;
|
uint32_t samples = image->info.samples;
|
||||||
uint32_t samples_log2 = ffs(samples) - 1;
|
uint32_t samples_log2 = ffs(samples) - 1;
|
||||||
|
enum radv_depth_decompress decompress;
|
||||||
VkPipeline *pipeline;
|
VkPipeline *pipeline;
|
||||||
|
|
||||||
if (!state->depth_decomp[samples_log2].decompress_pipeline[DECOMPRESS_DEPTH_STENCIL]) {
|
if (subresourceRange->aspectMask == VK_IMAGE_ASPECT_DEPTH_BIT) {
|
||||||
|
decompress = DECOMPRESS_DEPTH;
|
||||||
|
} else if (subresourceRange->aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) {
|
||||||
|
decompress = DECOMPRESS_STENCIL;
|
||||||
|
} else {
|
||||||
|
decompress = DECOMPRESS_DEPTH_STENCIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!state->depth_decomp[samples_log2].decompress_pipeline[decompress]) {
|
||||||
VkResult ret;
|
VkResult ret;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NUM_DEPTH_DECOMPRESS_PIPELINES; i++) {
|
for (uint32_t i = 0; i < NUM_DEPTH_DECOMPRESS_PIPELINES; i++) {
|
||||||
@@ -367,7 +378,7 @@ radv_get_depth_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DEPTH_DECOMPRESS:
|
case DEPTH_DECOMPRESS:
|
||||||
pipeline = &state->depth_decomp[samples_log2].decompress_pipeline[DECOMPRESS_DEPTH_STENCIL];
|
pipeline = &state->depth_decomp[samples_log2].decompress_pipeline[decompress];
|
||||||
break;
|
break;
|
||||||
case DEPTH_RESUMMARIZE:
|
case DEPTH_RESUMMARIZE:
|
||||||
pipeline = &state->depth_decomp[samples_log2].resummarize_pipeline;
|
pipeline = &state->depth_decomp[samples_log2].resummarize_pipeline;
|
||||||
@@ -468,7 +479,8 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
RADV_META_SAVE_SAMPLE_LOCATIONS |
|
RADV_META_SAVE_SAMPLE_LOCATIONS |
|
||||||
RADV_META_SAVE_PASS);
|
RADV_META_SAVE_PASS);
|
||||||
|
|
||||||
pipeline = radv_get_depth_pipeline(cmd_buffer, image, op);
|
pipeline = radv_get_depth_pipeline(cmd_buffer, image,
|
||||||
|
subresourceRange, op);
|
||||||
|
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
|
VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
|
||||||
|
Reference in New Issue
Block a user