Hash :
0892420b
Author :
Date :
2023-06-28T23:03:51
Vulkan: Optimize PBO download between RGBA and BGRA Google Meet hits this path in Chrome when blurring the background. The CPU readback was particularly slow on Intel/Mesa where readback from the temp buffer took hundreds of milliseconds. This change adds a compute shader that directly copies from the image to the pack buffer in simple but common cases. Bug: b/286882707 Change-Id: I9877ea01e3d8377db96f2539362aca67cf832b4a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4657058 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: 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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
// 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/CopyImageToBuffer.comp.00000000.inc:
// Pre-generated shader for the ANGLE Vulkan back-end.
#pragma once
constexpr uint8_t kCopyImageToBuffer_comp_00000000[] = {
0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0x5d,0x94,0x4d,0x68,0x9d,0x55,
0x10,0x86,0xcf,0x77,0xef,0xcd,0x4d,0xd2,0x86,0x36,0xa2,0xbd,0x9a,0xc6,0xa6,0x35,
0x81,0x66,0x91,0x10,0xba,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97,0x96,0xc0,0xdf,0xa2,0xfe,0x43,0xf2,0x96,0x98,0xdd,0x86,0x38,0x3b,
0x79,0xbd,0x87,0x8e,0x6b,0x19,0xae,0x76,0xc7,0xb5,0x02,0x9e,0xf2,0x56,0xc9,0x5d,
0xe1,0x4e,0xeb,0xbd,0x7e,0xc4,0x1b,0x5e,0xc5,0xff,0xa2,0x29,0xf2,0x88,0x73,0xfb,
0x37,0x66,0x2a,0xc6,0x66,0xe1,0x79,0x5b,0xff,0x03,0xb9,0x48,0x46,0x7a,0x3c,0x0a,
0x00,0x00
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// layout(local_size_x = 8, local_size_y = 8, local_size_z = 1)in;
//
// layout(set = 0, binding = 0)uniform texture2D src;
//
// layout(set = 0, binding = 1)buffer dst
// {
// uint destData[];
// };
//
// layout(push_constant)uniform PushConstants
// {
//
// uvec2 srcOffset;
// int srcDepth;
//
// bool reverseRowOrder;
//
// uvec2 size;
//
// uint outputOffset;
//
// uint outputPitch;
//
// bool isDstSnorm;
// } params;
//
// vec4 getSourceValue()
// {
// uvec2 coord = gl_GlobalInvocationID . xy;
// if(params . reverseRowOrder)
// {
// coord . y = params . size . y - coord . y - 1;
// }
// coord += params . srcOffset;
//
// vec4 srcValue = texelFetch(src, ivec2(coord), 0);
//
// return srcValue;
// }
//
// uint convertToDestValue(vec4 srcValue)
// {
//
// uvec4 normalized;
// if(params . isDstSnorm)
// {
// ivec4 scaled = ivec4(srcValue * 127.0);
// normalized = uvec4(scaled);
// }
// else
// {
// normalized = uvec4(clamp(srcValue, 0.0, 1.0)* 255.0);
// }
//
// normalized &= 0xFF;
//
// return normalized . r | normalized . g << 8 | normalized . b << 16 | normalized . a << 24;
//
// }
//
// void outputDestValue(uint destValue)
// {
// uint offset = params . outputOffset + params . outputPitch * gl_GlobalInvocationID . y + gl_GlobalInvocationID . x;
// destData[offset]= destValue;
// }
//
// void main()
// {
// if(any(greaterThanEqual(gl_GlobalInvocationID . xy, params . size)))
// return;
//
// vec4 srcValue = getSourceValue();
// uint destValue = convertToDestValue(srcValue);
// outputDestValue(destValue);
// }