Hash :
82219d28
Author :
Date :
2019-11-26T10:17:11
Vulkan: fix alpha values in convert vertex shader When reading vertex attributes, GLES requires the y and z components to be filled with 0 if missing, and the alpha channel to be filled with 1.0 for float types and 1 for integer types. At the same time, this change reduces the number of variations in this shader. Bug: angleproject:3192 Change-Id: I1bdf491952c296962fa9160f2d29d415eb3d570d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1936708 Reviewed-by: Jaedon Lee <jaedon1.lee@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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.