Hash :
8c341cfd
Author :
Date :
2023-10-04T12:49:59
Vulkan: Fix blits involving 3D images The layer vs depth value involved with 3D images when calling vkCmdBlitImage is fixed in this change. However, that brought to light that the combination of VUID-vkCmdBlitImage-srcImage-00240 and VUID-vkCmdBlitImage-dstImage-00252 make it impossible to blit between 3D and 2D array images, which is likely a spec oversight. This change makes 3D<->2DArray blits fall back to draw-based blit. This in turn exposed the fact that 3D images as src were not handled in BlitResolve.frag. A new Blit3DSrc.frag shader is added which shares code with BlitResolve.frag to implement this. This is a separate shader to avoid creating unnecessary and invalid combinations of shaders. VK_EXT_image_2d_view_of_3d could have been used to avoid this new shader, but that is not ubiquitous. Bug: angleproject:7291 Bug: dawn:1962 Change-Id: I6a96162f95829304b4731d43208d9d054f538105 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4911800 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
//
// Copyright 2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Limits:
// Note that max length and size is defined such that each buffer length is below 16KB, the minimum
// guaranteed supported size for uniform buffers.
#define MAX_TEXT_WIDGETS 32
#define MAX_GRAPH_WIDGETS 32
#define MAX_TEXT_LENGTH 256
#define MAX_GRAPH_SIZE 256
// Font information:
#define FONT_CHARACTERS 95
#extension GL_EXT_samplerless_texture_functions : require
struct TextWidgetData
{
uvec4 coordinates;
vec4 color;
uvec4 fontSize; // w unused. xy has the font glyph width/height. z has the mip.
uvec4 text[MAX_TEXT_LENGTH / 16];
};
struct GraphWidgetData
{
uvec4 coordinates;
vec4 color;
uvec4 valueWidth; // yzw unused. x should necessarily divide coordinate's z-x
uvec4 values[MAX_GRAPH_SIZE / 4];
};
layout(set = 0, binding = 0) uniform TextWidgets
{
TextWidgetData textWidgetsData[MAX_TEXT_WIDGETS];
};
layout(set = 0, binding = 1) uniform GraphWidgets
{
GraphWidgetData graphWidgetsData[MAX_GRAPH_WIDGETS];
};
layout(set = 0, binding = 2) uniform texture2DArray font;
layout(push_constant) uniform PushConstants
{
uvec2 viewportSize;
// Whether drawing text or graph widgets
bool isText;
// Prerotation support
bool rotateXY;
} params;