mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
anv/blit2d: Add a format parameter to bind_dst and create_iview
Signed-off-by: Jasosn Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 16ddda8452)
[Emil Velikov: don't attribute if using ISL_TILING_W. patches that
attribute and require the ISL_TILING_W handling aren't in 12.0]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/intel/vulkan/anv_meta_blit2d.c
This commit is contained in:
parent
7fe8cad4e4
commit
346f9e5a85
1 changed files with 9 additions and 4 deletions
|
|
@ -99,13 +99,14 @@ create_iview(struct anv_cmd_buffer *cmd_buffer,
|
||||||
VkImageUsageFlags usage,
|
VkImageUsageFlags usage,
|
||||||
uint32_t width,
|
uint32_t width,
|
||||||
uint32_t height,
|
uint32_t height,
|
||||||
|
VkFormat format,
|
||||||
VkImage *img,
|
VkImage *img,
|
||||||
struct anv_image_view *iview)
|
struct anv_image_view *iview)
|
||||||
{
|
{
|
||||||
const VkImageCreateInfo image_info = {
|
const VkImageCreateInfo image_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
||||||
.imageType = VK_IMAGE_TYPE_2D,
|
.imageType = VK_IMAGE_TYPE_2D,
|
||||||
.format = vk_format_for_size(surf->bs),
|
.format = format,
|
||||||
.extent = {
|
.extent = {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
|
|
@ -179,6 +180,7 @@ blit2d_bind_src(struct anv_cmd_buffer *cmd_buffer,
|
||||||
|
|
||||||
create_iview(cmd_buffer, src, offset, VK_IMAGE_USAGE_SAMPLED_BIT,
|
create_iview(cmd_buffer, src, offset, VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||||
rect->src_x + rect->width, rect->src_y + rect->height,
|
rect->src_x + rect->width, rect->src_y + rect->height,
|
||||||
|
vk_format_for_size(src->bs),
|
||||||
&tmp->image, &tmp->iview);
|
&tmp->image, &tmp->iview);
|
||||||
|
|
||||||
anv_CreateDescriptorPool(vk_device,
|
anv_CreateDescriptorPool(vk_device,
|
||||||
|
|
@ -328,10 +330,11 @@ blit2d_bind_dst(struct anv_cmd_buffer *cmd_buffer,
|
||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
uint32_t width,
|
uint32_t width,
|
||||||
uint32_t height,
|
uint32_t height,
|
||||||
|
VkFormat format,
|
||||||
struct blit2d_dst_temps *tmp)
|
struct blit2d_dst_temps *tmp)
|
||||||
{
|
{
|
||||||
create_iview(cmd_buffer, dst, offset, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
|
create_iview(cmd_buffer, dst, offset, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
|
||||||
width, height, &tmp->image, &tmp->iview);
|
width, height, format, &tmp->image, &tmp->iview);
|
||||||
|
|
||||||
anv_CreateFramebuffer(anv_device_to_handle(cmd_buffer->device),
|
anv_CreateFramebuffer(anv_device_to_handle(cmd_buffer->device),
|
||||||
&(VkFramebufferCreateInfo) {
|
&(VkFramebufferCreateInfo) {
|
||||||
|
|
@ -406,7 +409,8 @@ anv_meta_blit2d_normal_dst(struct anv_cmd_buffer *cmd_buffer,
|
||||||
|
|
||||||
struct blit2d_dst_temps dst_temps;
|
struct blit2d_dst_temps dst_temps;
|
||||||
blit2d_bind_dst(cmd_buffer, dst, offset, rects[r].dst_x + rects[r].width,
|
blit2d_bind_dst(cmd_buffer, dst, offset, rects[r].dst_x + rects[r].width,
|
||||||
rects[r].dst_y + rects[r].height, &dst_temps);
|
rects[r].dst_y + rects[r].height,
|
||||||
|
vk_format_for_size(dst->bs), &dst_temps);
|
||||||
|
|
||||||
struct blit_vb_data {
|
struct blit_vb_data {
|
||||||
float pos[2];
|
float pos[2];
|
||||||
|
|
@ -544,7 +548,8 @@ anv_meta_blit2d_w_tiled_dst(struct anv_cmd_buffer *cmd_buffer,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct blit2d_dst_temps dst_temps;
|
struct blit2d_dst_temps dst_temps;
|
||||||
blit2d_bind_dst(cmd_buffer, &dst_Y, offset, xmax_Y, ymax_Y, &dst_temps);
|
blit2d_bind_dst(cmd_buffer, &dst_Y, offset, xmax_Y, ymax_Y,
|
||||||
|
VK_FORMAT_R8_UINT, &dst_temps);
|
||||||
|
|
||||||
struct blit_vb_header {
|
struct blit_vb_header {
|
||||||
struct anv_vue_header vue;
|
struct anv_vue_header vue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue