src/compiler/translator/OutputVulkanGLSL.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi 9d519ab1 2019-05-09T23:09:46 Vulkan: Rework layout block storage conversion Previously, a pass over the shader was made, converting shared and packed interface blocks with block storage to std140. This resulted in link success between interface blocks with different storage as they were all translated to std140. With this change, this pass is removed. The link step proceeds with the block storage specifiers as seen by GLES, and only upon Vulkan GLSL shader generation "shared" and "packed" are converted to std140. Bug: angleproject:3199 Change-Id: I069415ab9c9b4e1034bc00f64cd2d9e2d73f5956 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1605262 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 5517ce95 2019-05-07T00:27:06 Vulkan: fix qualifier erase for unused vertex attributes Bug: angleproject:3219 Change-Id: I8f8f5572eed5126ab03702953883b313f022a264 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1598548 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 216f73d0 2019-04-12T13:32:30 Vulkan: add uniform buffer object support Support for layout qualifiers in interface blocks are added. All interface blocks are adjusted to either be in std140 or std430. In the Vulkan backend, a new descriptor set is added for UBOs. A dirty bit is added for UBO updating and pipeline layouts and descriptor bindings are updated. Bug: angleproject:3199, angleproject:3220 Change-Id: I271fc34ac2e1e8b76dee75e54a7cff0fe15fe4ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565061 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 62742f9e 2019-05-01T16:14:50 Vulkan: Optimize shader source macro replacement @@ LAYOUT-xx @@ and @@ QUALIFIER-xx @@ macros are generated by the compiler when emitting Vulkan GLSL. These macros are replaced at link time in the Vulkan backend. Previously, this replacement was done through calls to angle::ReplaceSubstring, reiterating over the whole source on every replacement. This CL does a prepass on the input source and chunks it up in blocks. Search is optimized as only blocks of a certain type are string-compared (skipping large chunks of shader text). Replace is optimized as the whole shader is not shifted left or right on every replacement. Additionally, this CL modifies the layout macro to the following format: @@ LAYOUT-xx(extra, args) @@ This is used in a follow up CL to have the compiler provide additional layout qualifiers. Bug: angleproject:3220 Change-Id: I6367e781c3304d5f2e0a406e4fb4e6feb4c45f1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1592070 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi e25ff9d8 2019-05-01T00:02:05 Vulkan: Fix qualifiers for varyings `out` variables in the vertex shader and `in` variables in the fragment shader were not decorated with `layout(location=?)` as they should according to the Vulkan GLSL spec. This change makes sure these decorations are present regardless of whether the compiler sees these variables as EvqVaryingIn/Out or EvqVertexOut/FragmentIn. Bug: angleproject:3412 Change-Id: I66473e876cb989a60b0c6d6a5850a8b2c763d8e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1590694 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 366df2b2 2019-01-18T15:40:34 Vulkan: Support external texture binding points. BUG=angleproject:2668 BUG=angleproject:3023 Change-Id: Idab0c4cbe1c7ed203ace50f1a6701dba11a40242 Reviewed-on: https://chromium-review.googlesource.com/c/1422548 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill c0bb36cb 2018-07-10T11:10:31 Vulkan: Add driver uniforms to shader. Bug: angleproject:2717 Change-Id: I542f3b0f2de21857d7fea0267f07d2d0eec78a8c Reviewed-on: https://chromium-review.googlesource.com/1131567 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 3ec304db 2018-04-18T14:14:25 Vulkan: Support struct initializers in shaders Also adds a new test in GLSLTest to validate the initialization of a struct on the same line as its declaration. Bug: angleproject:2459 Change-Id: Ib37e20378f8ec76541db26392663bcba03390756 Reviewed-on: https://chromium-review.googlesource.com/1017340 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Luc Ferron f1d3c20c 2018-04-16T07:44:27 Vulkan: Fix the issue with unused attributes / varyings When an attribute, a uniform or a varying isn't used, we now remove their layout and in/out qualifiers so that the shader can still refer to these var names. Bug: angleproject:2456 Change-Id: I5f1241d91bd46f663750adfab2562ef87ce69ae5 Reviewed-on: https://chromium-review.googlesource.com/1014009 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Luc Ferron d91c3793 2018-04-06T09:36:36 Vulkan: Implement support for structs in uniforms - Also enables 174 additional dEQP tests. Bug: angleproject:2446 Change-Id: I07cce46815d2f7a80fd48e7fd9407f7d528b397f Reviewed-on: https://chromium-review.googlesource.com/998406 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Olli Etuaho 8b5e8fdb 2017-12-15T14:59:15 Replace remaining usage of TName with TSymbol TName used to contain just a subset of the information stored in TSymbol. It makes more sense to use TSymbol directly instead of converting it to TName. This also improves type safety a bit by making some functions only take in TVariable or TFunction instead of the more generic TName. BUG=angleproject:2267 TEST=angle_unittests Change-Id: Icb46923c25d33ebbbbc06ddc487da25957dda771 Reviewed-on: https://chromium-review.googlesource.com/829143 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4dd167fb 2017-11-09T13:08:31 Vulkan: Assign locations to varyings. These were actually always required, but only was caught by the newer versions of the SPIR-V toolchain. BUG=angleproject:2237 Change-Id: I43fef179e8792e46a602b39a6decafcab03b19df Reviewed-on: https://chromium-review.googlesource.com/760638 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill de03e003 2017-10-21T14:04:20 Vulkan: Add shader handling for textures. BUG=angleproject:2167 Change-Id: I33940288331a23b940753795e5e43b8cabcb87f5 Reviewed-on: https://chromium-review.googlesource.com/732189 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6276b922 2017-09-25T02:35:57 Vulkan: Implement basic uniform shader parsing. This is a first step at implementing uniforms with descriptor sets. It does not actually bind uniforms and upload data, but it does implement uniform shader parsing. Uniforms are gathered into a single uniform block which is bound to set 0, with binding 0 for vertex uniforms and binding 1 for fragment uniforms. Also adds a ReplaceSubstring helper to string_utils. Also removes the precision writing from OutputVulkanGLSL since this was generating warnings with glslang. BUG=angleproject:2167 Change-Id: I9ec8351ec1973e583100f99292b0080ee968067b Reviewed-on: https://chromium-review.googlesource.com/699938 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 2a9e107c 2017-09-22T11:31:57 Vulkan: Support multiple vertex outputs. This is a bit of a hack, similar to how D3D11 works. We need to write output locations in the GLSL shader before we send them to glslang, so we wait until the link call, then string-replace some hard-coded identifeir code to the attribute location determined by ANGLE. This CL also fills in some of the vertex format conversion tables in formatutilsvk.cpp. BUG=angleproject:2167 Change-Id: I2424d0d990bdbcd831a4dd130e61e87d8f8f479f Reviewed-on: https://chromium-review.googlesource.com/677555 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Olli Etuaho a5e693af 2017-07-13T16:07:26 Make unique id counter a member of TSymbolTable This makes unique id counting thread-safe. BUG=angleproject:624 TEST=angle_unittests Change-Id: Ie0f2c7e574470b39750d37d2181c790bc874b275 Reviewed-on: https://chromium-review.googlesource.com/570419 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e794cd86 2017-01-13T17:29:51 Vulkan: Implement new GLSL translator back-end. The Vulkan GLSL translator back-end will handle validating and translating our WebGL/ESSL shaders into Vulkan-specific GLSL. glslang (the Vulkan one) accepts both GLSL and GLSL ES shaders as inputs, and both the desktop and ESSL back-ends give incompleteness warnings when used. For now, use the desktop GL 450 as a target for Vulkan GLSL. The Vulkan-specific changes are currently only to add locations to every vertex input and fragment output. BUG=angleproject:1575 Change-Id: I7c3f32f522e9d18e5f8618eb7927336bf4fbdcf2 Reviewed-on: https://chromium-review.googlesource.com/412266 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>