src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py


Log

Author Commit Date CI Message
Shahbaz Youssefi 149eb33b 2018-12-08T14:53:49 Vulkan: add possibility to build subset of shaders As the number of internal shaders grow, it's helpful in development time to be able to build variations of a specific shader, instead of building everything every time. With this commit, one can do: $ python gen_vk_internal_shaders.py SubString which will result in compilation of shaders whose name matches the glob *SubString*. Bug: angleproject:2958 Change-Id: I3b18d7e32e2ec4317531a7655eb2c6148cea177b Reviewed-on: https://chromium-review.googlesource.com/c/1369285 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 5c4af666 2018-12-07T06:31:00 Vulkan: unix line endings in generated shaders Bug: angleproject:3007 Change-Id: I466caa92ae337508ae284b6fb8d38f5fa3ea1042 Reviewed-on: https://chromium-review.googlesource.com/c/1366796 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi df8c1053 2018-11-29T11:49:45 Vulkan: Uber-shader generated code optimization Refactors code out of generated functions into a common function and simplifies assertions. Bug: angleproject:2958 Change-Id: I896c2304c3ac1e043c16f9ecf81fa8b72a6b87c0 Reviewed-on: https://chromium-review.googlesource.com/c/1355501 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi a1442ecd 2018-11-26T12:48:10 Vulkan: Uber-shader support For each internal shader, there is now possibly a companion .json file that defines shader variations. The variations consist of a set of flags and a set of enums. Each enum defines a variation that takes one of a few values. Flags are shorthands for 2-value enums. In the shader code, #if can be used to change the shader based on variations derived from flags and enums. On the C++ side, those variations are combined into an index and the appropriate shader is retrieved from a table. Bug: angleproject:2958 Change-Id: Ic4fc7061adb20c047c26624305285e3005092aab Reviewed-on: https://chromium-review.googlesource.com/c/1351117 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d47044ad 2018-04-27T11:45:03 Vulkan: Add framework for internal shaders. Vulkan intenal shaders are stored in a ShaderLibrary, and this is owned by the RendererVk. This way the shaders are reused between all the different Contexts. They are initialized lazily to keep init time low. They also have an associated Serial (called a ProgramSerial) so they can be identified in a PipelineDesc (used by the Pipeline cache). We use a python script to build and invoke the glslang validator, that also produces SPIR-V binary code snippets. These snippets are gathered into an auto-generated file that is exposed via an auto-generated header file. The InternalShaderID enum class gives access to the internal shaders that are shared through the Vulkan back-end. This also adds simple clear shaders to be used in masked color clears. The patch doesn't add any functionality but it is split off from the color clear functionality to keep the code size down. Bug: angleproject:2339 Bug: angleproject:2455 Change-Id: Ie83043eda217c9f013817b198c92a3b7ba0878b4 Reviewed-on: https://chromium-review.googlesource.com/1031372 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>