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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_vk_internal_shaders.py.
//
// Copyright 2018 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.
//
// shaders/gen/BlitResolve.frag.00000016.inc:
// Pre-generated shader for the ANGLE Vulkan back-end.
#pragma once
constexpr uint8_t kBlitResolve_frag_00000016[] = {
0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0x7d,0x93,0xdd,0x4e,0x53,0x41,
0x14,0x85,0xa7,0x2d,0xb4,0xa0,0x56,0x4a,0xb0,0x20,0xc6,0x08,0x8a,0x17,0x26,0x0a,
0xe1,0x42,0x0d,0x89,0xd1,0xe8,0x05,0x08,0x06,0x29,0x14,0x45,0x2e,0xd0,0x82,0x50,
0x02,0x01,0x5a,0x85,0xaa,0x8d,0x18,0x4d,0x10,0x7d,0x03,0x7d,0x09,0x9f,0xcf,0xf8,
0x93,0x98,0xb8,0xd7,0xe9,0x37,0xb8,0xc3,0x85,0x27,0xd9,0x67,0x66,0xaf,0xfd,0xbb,
0x66,0xcf,0x64,0xd2,0x43,0xb9,0x10,0x52,0xe1,0x44,0xe8,0x08,0x9f,0x43,0xeb,0xeb,
0x0e,0x69,0x43,0x5a,0xeb,0x97,0x9e,0x60,0xb6,0xce,0x30,0x3f,0xbb,0x50,0x19,0x5f,
0x7c,0x54,0xd9,0xdb,0x58,0x59,0xab,0xee,0x56,0xf6,0x1a,0xd5,0xda,0xea,0xe6,0x76,
0xa5,0xda,0x7c,0x51,0xdf,0x6d,0x98,0xef,0xc9,0x90,0x4d,0x62,0xee,0x4f,0xcf,0x4f,
0x8f,0xec,0x35,0xd6,0x46,0xae,0xdf,0x18,0x55,0xae,0xd3,0x21,0x93,0xe4,0x94,0xad,
0xcb,0x6a,0xb4,0xd9,0x2a,0xd9,0x59,0xd9,0xac,0x09,0x2f,0x98,0x4c,0x98,0x94,0x92,
0x7d,0x26,0xb1,0xe5,0xdc,0xfe,0x94,0x72,0xda,0xae,0x90,0xd4,0x50,0x8e,0x10,0x26,
0x43,0x7b,0xe8,0xa5,0xd7,0x21,0xd6,0x88,0xa5,0xc0,0x3a,0x1c,0x96,0x06,0x2b,0x38,
0x2c,0x03,0x76,0xd6,0x61,0x6d,0x60,0xe7,0x1d,0xd6,0x0e,0x36,0xe8,0xb0,0x2c,0xd8,
0x65,0x87,0xe5,0xc0,0xae,0x38,0xac,0x03,0xec,0x9a,0xc3,0x3a,0xc1,0x46,0x13,0x5e,
0x99,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x27,0xc0,0x94,0x4b,0xef,0x65,0x9e,0xb7,0xa2,
0x5c,0x7a,0x27,0x0b,0x60,0xc7,0x73,0xe9,0x1c,0x9e,0x60,0xd7,0xf7,0x8e,0x19,0x2c,
0x82,0x2b,0x77,0x09,0xfd,0x8f,0xb1,0x1b,0x33,0xf9,0x0b,0x5e,0x1d,0x06,0x2b,0x84,
0x07,0x00,0x00
};
// Generated from:
//
// #version 450 core
//
// #extension GL_GOOGLE_include_directive : require
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// #extension GL_ARB_shader_stencil_export : require
//
// layout(set = 0, binding = 0)uniform texture2DMS depth;
//
// layout(set = 0, binding = 1)uniform utexture2DMS stencil;
//
// #line 1 "shaders/src/BlitResolve.inc"
//
// layout(push_constant)uniform PushConstants {
//
// ivec2 offset;
// vec2 stretch;
// vec2 invSrcExtent;
// int srcLayer;
// int samples;
// float invSamples;
//
// int outputMask;
//
// bool flipX;
// bool flipY;
// bool rotateXY;
// } params;
//
// ivec2 getSrcImageCoords()
// {
//
// ivec2 srcImageCoords = ivec2(gl_FragCoord . xy);
//
// srcImageCoords -= params . offset;
//
// if(params . flipX)
// srcImageCoords . x = - srcImageCoords . x;
// if(params . flipY)
// srcImageCoords . y = - srcImageCoords . y;
// if(params . rotateXY)
// srcImageCoords . xy = srcImageCoords . yx;
//
// return srcImageCoords;
// }
//
// #line 123 "shaders/src/BlitResolve.frag"
//
// void main()
// {
// ivec2 srcImageCoords = getSrcImageCoords();
//
// gl_FragDepth = texelFetch(depth, srcImageCoords, 0). x;
//
// gl_FragStencilRefARB = int(texelFetch(stencil, srcImageCoords, 0). x);
//
// }