Hash :
22ed9877
Author :
Date :
2024-03-07T15:52:13
Vulkan: Generate fragment shading rates with compute Generating fragment shading rates on the CPU could cause avoidable stalls or increased latencies due to host<->device synchronization. Instead generate the rates using a compute shader. Optimize foveated rendering by treating a foveated draw with focal points whose gainX or gainY is 0 as if it were an un-foveated draw Bug: angleproject:42266906 Change-Id: If8c5504087997666c7d0c1cae8dcc5fab847187e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5754322 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.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.