radv: add radv_htile_get_initial_value() and document the HTILE dword

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8039>
This commit is contained in:
Samuel Pitoiset
2020-12-09 17:51:10 +01:00
committed by Marge Bot
parent 3038c88661
commit 1c539b6484
2 changed files with 31 additions and 1 deletions

View File

@@ -6000,7 +6000,7 @@ static void radv_initialize_htile(struct radv_cmd_buffer *cmd_buffer,
assert(range->levelCount == 1 || range->levelCount == VK_REMAINING_ARRAY_LAYERS);
VkImageAspectFlags aspects = VK_IMAGE_ASPECT_DEPTH_BIT;
struct radv_cmd_state *state = &cmd_buffer->state;
uint32_t htile_value = radv_image_tile_stencil_disabled(cmd_buffer->device, image) ? 0xfffc000f : 0xfffff3ff;
uint32_t htile_value = radv_get_htile_initial_value(cmd_buffer->device, image);
VkClearDepthStencilValue value = {0};
struct radv_barrier_data barrier = {0};

View File

@@ -2088,6 +2088,36 @@ radv_get_ds_clear_value_va(const struct radv_image *image,
return va;
}
static inline uint32_t
radv_get_htile_initial_value(const struct radv_device *device,
const struct radv_image *image)
{
uint32_t initial_value;
if (radv_image_tile_stencil_disabled(device, image)) {
/* Z only (no stencil):
*
* |31 18|17 4|3 0|
* +---------+---------+-------+
* | Max Z | Min Z | ZMask |
*/
initial_value = 0xfffc000f;
} else {
/* Z and stencil:
*
* |31 12|11 10|9 8|7 6|5 4|3 0|
* +-----------+-----+------+-----+-----+-------+
* | Z Range | | SMem | SR1 | SR0 | ZMask |
*
* SR0/SR1 contains the stencil test results. Initializing
* SR0/SR1 to 0x3 means the stencil test result is unknown.
*/
initial_value = 0xfffff3ff;
}
return initial_value;
}
unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t family, uint32_t queue_family);
static inline uint32_t