Commit 2ef23e2d72e7811a607f53ea12e672c3287375bd

Olli Etuaho 2017-11-01T16:39:11

Fix writing uniform block maps to HLSL output HLSL output maps structs in std140 uniform blocks to a different layout in order to eliminate padding. The padding may have been inserted to comply with std140 packing rules. There used to be two issues in writing the maps: Sometimes the same map could be written multiple times, and the maps were not being written for uniform blocks with instance names. Rewrite how the uniform buffer struct maps get generated so that the code works correctly. Instead of flagging accesses, structs inside uniform blocks are gathered from uniform block declarations. When accesses to structs in uniform blocks are written out in OutputHLSL, it's checked whether a mapped struct needs to be used instead of the original one. This code could still be optimized further by limiting mapped structs generation to those ones that really need to be used. This is left to be done later. BUG=angleproject:2084 TEST=angle_end2end_tests Change-Id: Iee24b3ef15847d2af64554ac74b8e4be5060d18c Reviewed-on: https://chromium-review.googlesource.com/751506 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>