Hash :
1301402c
Author :
Date :
2023-03-23T21:56:45
Vulkan: improve etc to bc grident texture precison. ETC has gradient modes. Two endpoints in BC are RGB565; the color depth is lower than ETC. Two endpoints in RGB888 space may be quite different, but after conversion to RGB565 they may be projected to the same point. This conversion loses quite a lot of details. This change tries to change one endpoint to an adjacent one (not optimal) in RGB565, so that all the colors are interpolated from these two endpoints. With this change, the arknight image in b/259327729 improved PSNR from 39 to 49. This change includes some of work by @gregschlom 1) Use look up table instead of bit operation. 2) Use more vector operations. This may not improve the performance but makes the code short and neat. bug: b/259327729 Change-Id: Ic0720aff17af5d466e5598dc38ba953dc084a3cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4368021 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
To build multiple variations of a shader, add a file named X.json corresponding to shader file X. A variation is generated by building the shader with different definitions (a la glslang_validator’s -DName=1). These definitions come from flags and enumerations defined in the json file. Without a .json file, the shader is generated as is (1 variation).
There are multiple possible fields in the json file:
Flags are shorthand for 2-entry enumerations. Given n flags, there are 2^n variations where every flag is either present or not. For enumerations, only one entry is active in any variation. Thus, an enumeration with n entries generates n variations.
Here is an example json file:
{
"Description": [
"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.",
"",
"RayTrace.comp.json: Build parameters for RayTrace.comp."
],
"Flags": [
"NanFilter",
"WorkaroundIntelBug"
],
"RayTraceQuality": [
"IsRTLowRes",
"IsRTHighRes",
"IsRTAwesome"
],
"ImageType": [
"IsR",
"IsRG",
"IsRGB",
"IsRGBA"
]
}
This will generate 2^2 3 4 shaders.