Hash :
a532570a
Author :
Date :
2019-03-20T10:18:36
Vulkan: Cleanups to shader generation script. Fixes the suprious newlines messages. Also prefer a Release directory when writing shaders for performance. Also adds glslang's git HEAD to the list of generated hashes. This should ensure we regenerate all shaders when there's a roll of glslang. Glslang was rolled prior to this CL. Also update the SPRI-V libs. Bug: angleproject:3227 Change-Id: I1fd212a08000c08ef41b60c4201edd3ac771f91d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516512 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@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.