Commit 06a2262078b2a21d173b2562ee0440d00ab9e549

Xinghua Cao 2018-05-18T16:48:41

ES31: Use indices to access image variables in built-in image functions In order to implement glBindImageTexture to bind a layer of 3D/2DArray/Cube texture, use indices to access image variables when translating built-in image functions. There is a conflict when transferring image2D/iimage2D/uimage2D variables to an user defined function. For example, layout(r32ui, binding = 0) readonly uniform highp uimage2D uImage_1; layout(r32ui, binding = 1) readonly uniform highp uimage2D uImage_2; uvec4 lod_fun(uimage2D img, ivec2 p) { return imageLoad(img, p); } void main() { uvec4 value_1 = lod_fun(uImage_1, ivec2(gl_LocalInvocationID.xy)); uvec4 value_2 = lod_fun(uImage_2, ivec2(gl_LocalInvocationID.xy)); } If uImage_1 binds to a 2D texture, and uImage_2 binds to a layer of 3D texture, uImage_1 will be translated to Texture2D type, and uImage_2 will be translated to Texture3D type, "img" type of lod_fun will be translated Texture2D, so uImage_2 cannot be transferred to lod_fun as a parameter. Indices without Texture/RWTexture information could handle this situation easily. BUG=angleproject:1987 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: I7647395f0042f613c5d6e9eeb49392ab6252e21e Reviewed-on: https://chromium-review.googlesource.com/1065797 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>