src/libGLESv2/ProgramBinary.cpp


Log

Author Commit Date CI Message
Brandon Jones eb99436e 2014-09-24T10:27:28 Moving Shader Executables into ProgramD3D BUG=angle:731 Change-Id: I677fc9773914307184bcdd9ab7ac564956d77f6a Reviewed-on: https://chromium-review.googlesource.com/219814 Tested-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Brandon Jones 18bd4100 2014-09-22T14:21:44 Removed the last references to Renderer from ProgramBinary. BUG=angle:731 Change-Id: I8829a434e59279b1b9c37e9a1922ae05d467b376 Reviewed-on: https://chromium-review.googlesource.com/219421 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Brandon Jones 44151a97 2014-09-10T11:32:25 Removed the last references to DynamicHLSL from ProgramBinary. Migrated several more non-generic values from ProgramBinary the D3D impl. BUG=angle:731 Change-Id: Ic043dd75328cffbc6bef6556da801c382b4138bc Reviewed-on: https://chromium-review.googlesource.com/219390 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Geoff Lang c77e8c39 2014-09-08T16:28:24 Update the draw calls to return Error objects. BUG=angle:520 Change-Id: I3330ba2dbe095fc9460789822a938420a80a149f Reviewed-on: https://chromium-review.googlesource.com/213823 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 76b10c9a 2014-09-05T16:28:14 Use dynamically sized containers for texture and sampler bindings. BUG=angle:685 Change-Id: I7af97a95deee69fbdebca2b57403244f45516e67 Reviewed-on: https://chromium-review.googlesource.com/216564 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross af875527 2014-08-25T21:06:07 Improve D3D11 varying packing when there are more varyings than registers. BUG=angle:738 Change-Id: I0599840fc79d571230acf26105d512322bcffdcd Reviewed-on: https://chromium-review.googlesource.com/214108 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang be4fdb3f 2014-09-16T14:11:40 Merge the sampler uniform application into ProgramBinary::setUniform. * Fixes incorrect dirty checks for the dirty sampler mappings flag. * Fixes WebGL tests: * conformance_canvas_texture_bindings_unaffected_on_resize * conformance_reading_read_pixels_test * conformance_uniforms_uniform_default_values BUG=414450 Change-Id: I132dbc301a236aef153fb6da4c6b64c36b0ba3f3 Reviewed-on: https://chromium-review.googlesource.com/218501 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 61f54180 2014-09-16T14:10:02 Don't modify the function parameters in ProgramBinary::setUniform. BUG=414450 Change-Id: Ib5ebf18e57af671b8694ffcfc3cb152557f7f002 Reviewed-on: https://chromium-review.googlesource.com/218500 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Brandon Jones 22502d52 2014-08-29T16:58:36 Moving more D3D-only logic into ProgramBinaryD3D BUG=angle:731 Change-Id: Ia62ec9a912c8bd63fcee51ca206d52688dd999da Reviewed-on: https://chromium-review.googlesource.com/217495 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Brandon Jones c9610c51 2014-08-25T17:02:59 Starting refactor of ProgramBinary This is gonna take a while... BUG=angle:731 Change-Id: Ief72c3361b6429f3f6e0bc2d2ea0810d523ff178 Reviewed-on: https://chromium-review.googlesource.com/215661 Tested-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill f6be8d7c 2014-09-05T10:38:07 Fix typo in "PixelShaderOuputVariable". Change-Id: I2b223c9b80faa3ff2a0f94bd52ca73edf3d67cf7 Reviewed-on: https://chromium-review.googlesource.com/216273 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill f9479eff 2014-09-05T10:38:05 Drop support for the old "full multiplexed" MRT shaders. This will simplify the code somewhat. It should no longer be necessary now that we have the nVidia workaround. BUG=angle:705 Change-Id: I1abe1abd9f03472341ce4315975a76c56b252bb4 Reviewed-on: https://chromium-review.googlesource.com/216111 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3f2e61de 2014-09-05T10:38:05 Enable MRT pixel shader rewriting. Writing to all 8 pixel outputs was causing performance problems on Intel and AMD. Enabling Geoff's work to rewrite our pixel shaders solves the regression. This patch also includes a workaround to the nVidia driver bug where it would ignore NULL RT values in OMSetRenderTargets, by compacting the RT list to skip NULL values. BUG=angle:705 BUG=365078 Change-Id: Ia68af6f0ccd5f10c484d6f76297a0bec694948f0 Reviewed-on: https://chromium-review.googlesource.com/214852 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill aef95dec 2014-09-05T10:12:41 Use attachment binding points for dynamic PS key. Because our output signature is only dependent on the arrangment of the attachments, not the attachment type, use the output layout key for now. If we need to, we could store both, in the future. BUG=angle:705 Change-Id: I3b99954d30b91a4741fdd6f48f8ffcf88c0bea7a Reviewed-on: https://chromium-review.googlesource.com/215846 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 04668675 2014-09-03T09:40:49 Mark shared and std140 UBOs as always active. This aligns ANGLE with the GL spec. With this fix, we pass all of the dEQP conformance tests in Functional / Uniform Buffer Object that don't rely on single buffers. BUG=angle:507 Change-Id: I6063a416e3f7ee6d5327d96850e3d0cc8521c817 Reviewed-on: https://chromium-review.googlesource.com/213506 Reviewed-by: Nicolas Capens <capn@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 54ad4f81 2014-09-03T09:40:46 Use the CollectVariables path on the HLSL translator. This approach consolidates our two methods, and lets us reuse the same code for both methods of variable collection. BUG=angle:466 Change-Id: Ie92f76ff0b6d0d0dbfd211a234d0ab86290fa798 Reviewed-on: https://chromium-review.googlesource.com/213504 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 2ad1dc48 2014-09-03T09:40:45 Compact the D3D shader specializations into one. BUG=angle:731 Change-Id: I4f35a05aeea130f9011ec62cfe931ed23e2681c9 Reviewed-on: https://chromium-review.googlesource.com/214871 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d15250e6 2014-09-03T09:40:44 Move shader variables into the base impl. These variable types apply across shader types. Either we'll want a way to cache them after we query them, or we'll do a pre-parse pass similar to our current Chromium GLSL to GLSL pre-pass where we store the variables in ANGLE. In either case, they're shared across GL implementations so make sense as queries from gl::Shader. BUG=angle:731 Change-Id: I23f5541423abb4af87a2bc2fc1e9f4047fd2ff90 Reviewed-on: https://chromium-review.googlesource.com/214870 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Brandon Jones 43a53e24 2014-08-28T16:23:22 Converted ProgramBinary to use Context caps instead of Renderer BUG=angle:731 Change-Id: I9bbce69cabf767fb5fb2c94f437a9950bc79d1aa Reviewed-on: https://chromium-review.googlesource.com/215370 Tested-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 05881a0f 2014-07-10T14:05:30 Add caps for transform feedback limits from table 6.34. BUG=angle:658 Change-Id: Ifd8c620080c8de486ffb7c8f9e985be1aba516c1 Reviewed-on: https://chromium-review.googlesource.com/207376 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 3a61c321 2014-07-10T13:01:54 Add caps for the aggregate shader limits from table 6.33. BUG=angle:658 Change-Id: I59d0cd131114fcb925f01d83d218a657f4498a2a Reviewed-on: https://chromium-review.googlesource.com/207375 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0b7eef7c 2014-06-12T14:10:47 Removed common_includes.h reordered includes. Since we are not using precompiled headers anymore, remove common_includes.h so that fewer files are included in cpp files. Reordered includes to be in the following order: 1) Local ANGLE project headers, ordered by directory in descending depth 2) GL headers 3) STL headers This helps enforce the include-what-you-use principal by reducing the number of STL headers unexpectedly shared between files. This include order conflicts with some of the Google c++ style guide which states that STL includes should be first but this helps us catch more issues. Change-Id: I8f7785f4ad574e253dd3c7b4fb1e54d3ce3b99fc Reviewed-on: https://chromium-review.googlesource.com/214850 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Brandon Jones d8d72434 2014-08-22T15:11:23 Moved DynamicHLSL into renderer/d3d Obviously D3D-only class is obvious. :) BUG=angle:731 Change-Id: Ide54e76a8b9bacb9b6834e2cb0a801140eecfe46 Reviewed-on: https://chromium-review.googlesource.com/213862 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Brandon Jones 7162096e 2014-08-20T14:04:59 More shader refactor cleanup Removed VertexShader and FragmentShader in favor of using a single Shader object Used VertexShaderD3D and FragmentShaderD3D directly when appropriate. BUG=angle:731 Change-Id: Ib1ffdf85ee0bfa7c88bb9ddb1029ccbd63a9dbe1 Reviewed-on: https://chromium-review.googlesource.com/213840 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Jamie Madill ea24759f 2014-08-28T10:37:08 Remove remnants of old PCH code. Remove the precompiled.cpp file which was producing a build warning, and rename the header to make it clear we no longer support PCH. BUG=angle: Change-Id: I944081ae477b1478ca9c18924fb02bb920d420a7 Reviewed-on: https://chromium-review.googlesource.com/214187 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill a6f267f9 2014-08-27T11:44:15 Fix row-major layout tracking in interface blocks. Some block field types, such as nested structs, were bugged. This only affects our "CollectVariables" path, not our current HLSL UBO path. BUG=angle:466 Change-Id: I2b8daf58aa7ec1ad06a80d38f57e76087eacccdc Reviewed-on: https://chromium-review.googlesource.com/213503 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Brandon Jones f05cdee4 2014-08-27T15:24:07 Refactoring Shader objects (Take 2) This change refactors shaders to no longer be dependent on D3D-only concepts. BUG=angle:731 Change-Id: I1006112f1d31b7e41bd14bd3225ea157b7d6c6c9 Reviewed-on: https://chromium-review.googlesource.com/214467 Tested-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Brandon Jones e54be46a 2014-08-27T22:21:45 Revert "Refactoring Shader objects" This reverts commit 537dfde52a33d621ab1198c949a81b09a1269b2e. Change-Id: I5eb8923ac8f78877e6e77a8cd897021e56ee004a Reviewed-on: https://chromium-review.googlesource.com/214466 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Brandon Jones 537dfde5 2014-08-20T14:04:59 Refactoring Shader objects This change refactors shaders to no longer be dependent on D3D-only concepts. BUG=angle:731 Change-Id: I4fc1efeba9df4f873b3d7c8ba6f67f00b6532b9c Reviewed-on: https://chromium-review.googlesource.com/213803 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Brandon Jones <bajones@chromium.org>
Jamie Madill 99a1e985 2014-08-25T15:47:54 Move GetUniform size validation to top layer. BUG=angle:571 Change-Id: Ie7064cf85f6a125ccd6cdf1bff89443520e2a06d Reviewed-on: https://chromium-review.googlesource.com/212932 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 42bcf32e 2014-08-25T16:20:46 Refactor ShaderVariables to store fields in the base. Instead of only storing structure information in Varyings, Uniforms and Interface Block Fields, store it in the base class. Also only store base variable information for struct fields, instead of fully typed information. This works because stuff like interpolation type, invariance, and other properties are for the entire variable, not individual fields. Also add new fields for interface block instance name, varying invariance and structure name for all struct types. BUG=angle:466 Change-Id: If03fc071e6becb7aad6dea5093989bba7daee69e Reviewed-on: https://chromium-review.googlesource.com/213501 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Geoff Lang 301d161d 2014-07-09T10:34:37 Add caps for vertex and fragment shader limits from tables 6.31 and 6.32. BUG=angle:658 Change-Id: I98509aa16caf74c3e4e28852e8b59aedd903f03a Reviewed-on: https://chromium-review.googlesource.com/207372 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 900013cd 2014-07-07T11:32:19 Add caps from the 6.29 table. BUG=angle:658 Change-Id: I392f581b1aea445d60f507c1fa897c4348c1a137 Reviewed-on: https://chromium-review.googlesource.com/207371 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill cafa2102 2014-07-23T16:43:22 Fix Clang warnings. MSVC's more permissing validator missed a dependent typename, and deleting a void pointer. BUG=angle:703,704 Change-Id: I227b94c9c1590973d7b11b0ed0bfda32f2a71cec Reviewed-on: https://chromium-review.googlesource.com/209613 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e04a5b7b 2014-07-18T10:33:12 Remove sh::InterfaceBlock member info. We can compute the interface block member info entirely on the API side. This will allow us to get rid of some un-necessary code in the compiler. BUG=angle:466 Change-Id: I664ffc82de5f2723156e51f4e9ffc07e4de162aa Reviewed-on: https://chromium-review.googlesource.com/207781 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill bf9cce2e 2014-07-18T10:33:09 Use the block encoder class to store uniform offsets. This will allow us to use the same code path for assigning register information in all places. Because of this it fixes some long-broken dEQP struct uniform tests. BUG=angle:466 BUG=angle:505 Change-Id: I4161a388503aa09bbe2d21ff47bfb3352ec93881 Reviewed-on: https://chromium-review.googlesource.com/207255 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 5b130dcc 2014-07-11T17:02:05 Do not create dummy variables when linking uniforms. This cleanup prepares us for removing the uniform register info from the shader translator types. BUG=angle:466 Change-Id: I86f47970b793135f410a5ef698fc96d44219ee96 Reviewed-on: https://chromium-review.googlesource.com/207253 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 66d43d24 2014-07-11T17:02:03 Refactor ProgramBinary uniform linking code. This prepares us for moving most of the register assignment to the ProgramBinary class itself, and cleans up the various methods. BUG=angle:466 Change-Id: Ie2965ed41ac50617584fd7a6d7b0ec2784e7dfaf Reviewed-on: https://chromium-review.googlesource.com/207252 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill fc43d273 2014-07-11T17:02:02 Remove the sh::InterfaceBlock::dataSize member. We can replace this by doing the same calculation in the HLSL-side code. BUG=angle:466 Change-Id: Iecae4a92e9037e851419ce73e6267094ee8071a2 Reviewed-on: https://chromium-review.googlesource.com/207251 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill d4116ff3 2014-07-11T17:02:01 Remove sh::InterfaceBlock::registerIndex. This value is HLSL-only and we can use the new query API to hide it from GLSL programs. BUG=angle:466 Change-Id: I75dc2fbbf1b29b1f6d561568174a15dea1f5b130 Reviewed-on: https://chromium-review.googlesource.com/207250 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill d4cfa57d 2014-07-08T10:00:32 Move more draw call validation to the API. The GL expects us to reject invalid draw calls before we start doing any work, so we can prevent internal unnecessary state changes. Also update the program binary's cached sampler data when we validate. The previous patch was breaking draw calls in Google Earth WebGL. BUG=angle:571 BUG=390412 Change-Id: I1c4e204ae2467afc36b76af975a3a49e26349639 Reviewed-on: https://chromium-review.googlesource.com/206482 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e92a3546 2014-07-03T10:38:58 Remove redundant FBO query methods. Several query methods simply wrapped a NULL check with a default return value. Most of these safety checks were unnecessary. BUG=angle:660 Change-Id: I0ac6897f06be082c8efab8721920d1b51ba999ee Reviewed-on: https://chromium-review.googlesource.com/205606 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Ehsan Akhgari aa7e1660 2014-07-05T21:13:11 Improve the const correctness. This improvement to the const correctness makes ProgramBinary::save compile with clang-cl as well, which is more strict than MSVC. Change-Id: Iae091643fa1df7f094b89dbe7529c4e173f04a6d Reviewed-on: https://chromium-review.googlesource.com/206714 Tested-by: <ehsan@mozilla.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Brandon Jones d38f926a 2014-06-18T16:26:45 Refactoring Buffers BUG=angle:681 Change-Id: I6c3809e0b9468dfe38465c55759c2572c21485da Reviewed-on: https://chromium-review.googlesource.com/204896 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill f2575989 2014-06-25T16:04:54 Use the sh namespace for shader variables. Since these types originate from the translator, use an appropriate namespace. Also rename some of the gl helper functions to be more specific to their functionality. BUG=angle:466 Change-Id: Idc29987b2053b3c40748dd46b581f3dbd8a6fd61 Reviewed-on: https://chromium-review.googlesource.com/204680 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill e261b44a 2014-06-25T12:42:21 Remove obsolete Renderbuffer types. RenderbufferProxySet and FramebufferTextureBindingPointer aren't necessary any more with our refactored renderbuffer classes and ownership of attachments by the Framebuffer. We can also consolidate the FramebufferAttachment and implementation to a single class, and no longer need to store ref counted objects in the Framebuffer class directly. BUG=angle:660 Change-Id: Idcc06dfb42b47242b33494e797a0ba06d6669511 Reviewed-on: https://chromium-review.googlesource.com/201838 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Brandon Jones c7a41049 2014-06-23T12:03:25 Moved D3D specific files and folders under the D3D folder. Change-Id: I8afd67e08ee558fe94532c377d079673357a7192 Reviewed-on: https://chromium-review.googlesource.com/205229 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 04fb89ad 2014-06-09T15:05:36 Generate pixel shader output to match the bound framebuffer. Only generate pixel shader output variables for render targets that are currently bound. Fixes some performance issues with D3D10 cards that were slow to discard unused outputs. Fixed memory leaks in ProgramBinary by refactoring the freeing of the current state into a reset function. BUG=angle:670 Change-Id: I40f83e15724fb9a1a9ae61363a056999f1fa26d2 Reviewed-on: https://chromium-review.googlesource.com/202977 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9c4b24a5 2014-06-12T13:41:17 Use commit_id.py on Windows, and handle missing git. This allows us to delete the Windows batch file. Changes the commit_id script to take the working directory so that it can be called from a different working directory than the angle repository is in. Renames the generated commit header to angle_commit.h. This is being written to the shared generated code directory for the entire build, and "commit.h" is insufficiently unique. BUG=angle:669 Change-Id: I35e80411a7e8ba1e02ce3f6a4fc54ed4dbc918f3 Reviewed-on: https://chromium-review.googlesource.com/202048 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Vladimir Vukicevic 24d8d675 2014-05-27T12:07:51 Fix register packing for structs in d3d9. Fixes WebGL test misc/shader-with-array-of-structs-uniform BUG=angle:656 Change-Id: If79a19db4d40bab9110422f7876de32e7f85e506 Reviewed-on: https://chromium-review.googlesource.com/200620 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Jamie Madill c600c8c3 2014-05-16T11:22:21 Fix arrays-of-struct and nested struct uniforms. Our computation of register offsets had a few errors that messed up nested structs and arrays of structs. This fixes a WebGL test, as well as several dEQP tests. BUG=angle:505 TEST=WebGL CTS 1.0.3, dEQP-GELS3.functional.uniform-api Change-Id: Id5a0f39481e079fe5ef5ef856943dc1f91ee3639 Reviewed-on: https://chromium-review.googlesource.com/200045 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3639892d 2014-05-20T14:51:53 Move all uniform validation from ProgramBinary to API layer. This will have the contract of having a successful API call once we call into the ANGLE internals, having successfully passed valiation. BUG=angle:571 Change-Id: Ia8d6eccc1e42bdf9e9cc5c10094a08729b42778a Reviewed-on: https://chromium-review.googlesource.com/200075 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1b2a8f96 2014-05-14T13:09:39 Fix binary serialization to use explicit size and type. Loading program binaries across different architectures would cause runtime errors due to use of size_t. Also fix the ANGLE major and minor version that were clobbered in an earlier commit. BUG=angle:647 BUG=371435 Change-Id: I9473cc7e119592fce336aa47881839543e337b69 Reviewed-on: https://chromium-review.googlesource.com/199633 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang ae1990c8 2014-05-12T16:57:14 Track if uniform data has been updated to avoid extra Map calls. Compare all uniform data to the values currently stored in the uniform and only mark the uniform as dirty if the data is new. This saves lots of buffer map calls when the same data is set on a uniform many times. BUG=260069 Change-Id: Ic4df8a276a81b074211712ff50e5cc4d0d9bb612 Reviewed-on: https://chromium-review.googlesource.com/199346 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill ff0d2ba6 2014-05-14T13:49:10 Split register allocation of varyings from the translator. The translator gl::Varying struct does not need to know about register allocation. We can put that entirely in the API library. This makes exposing Varying variables with the new translator types cleaner. BUG=angle:466 Change-Id: Ib85ac27de003913a01f76d5f4dc52454530859e6 Reviewed-on: https://chromium-review.googlesource.com/199736 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f8fcc24 2014-05-14T13:49:09 Remove gl::Varying::elementIndex. We only assigned to elementIndex, and never referenced the value at any point in our code. BUG=angle:466 Change-Id: I541a353110bcd1863b07b21bcf21fad38be19ca1 Reviewed-on: https://chromium-review.googlesource.com/199735 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 11c3b30f 2014-05-13T22:33:31 Revert "Fix binary serialization to use explicit size and type." This reverts commit 261988513e89479a0d121d045a8d89b64dc68214. Change-Id: I959ca14fcbb257f12005f7f0b64a600e906a118c Reviewed-on: https://chromium-review.googlesource.com/199630 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 26198851 2014-05-12T15:49:38 Fix binary serialization to use explicit size and type. Loading program binaries across different architectures would cause runtime errors due to use of size_t. Also fix the ANGLE major and minor version that were clobbered in an earlier commit. BUG=angle:647 BUG=371435 Change-Id: If2ad4c8fc246cc9ff0b4d95ba87b7d1ed109a064 Reviewed-on: https://chromium-review.googlesource.com/199102 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 07d68856 2014-05-06T16:31:14 Move the implementations of shader var init to the header. Making the contructors for shader variables inline saves us from exporting them across DLL boundaries. This makes it easier to use them in the translator when building the translator as a DLL. BUG=angle:466 Change-Id: Iee0556e06dc1f9e98fe9eea6577819305de0dd0b Reviewed-on: https://chromium-review.googlesource.com/198555 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7a29e4ae 2014-05-02T10:41:48 Stop generating duplicate vertex binaries. We would generate multiple vertex binaries that result in the same HLSL code, eg for vec2 and vec3 vertex attributes. Eliminate duplicates by using the converted attribute type for testing for matching binaries. BUG=angle:599 Change-Id: I061588164577ff9fa69ebb7d8a3f2bf6bb6fe013 Reviewed-on: https://chromium-review.googlesource.com/197830 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang cc14f104 2014-05-05T17:00:40 Use a static function instead of a static initializer for defaultBlockInfo. BUG=angle:640 Change-Id: I5fe568c9a2b492a5bd8a42142762229c5f992c7e Reviewed-on: https://chromium-review.googlesource.com/198248 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 834e8b77 2014-04-11T13:33:58 Move ShaderVariables to common shared source. Also move the block layout encoding utilities to the common folder. The combined changes allow us to include the shader and block code into both libGLESv2 and the translator separately. This in turn fixes the Chromium component build, where we were calling internal translator functions directly from libGLESv2. BUG=angle:568 Change-Id: Ibcfa2c936a7c737ad515c10bd24061ff39ee5747 Reviewed-on: https://chromium-review.googlesource.com/192891 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ac0a267b 2014-04-11T13:33:56 Fix non-square matrix vertex attributes. When we generate an input signature for a vertex shader, we should use the transpose of the matrix type instead of the matrix type itself. This was breaking dEQP tests 'shaders.functions.datatypes'. BUG=angle:594 Change-Id: Ia945ffd865d7255500f7a62394bcd5bdfbbedef4 Reviewed-on: https://chromium-review.googlesource.com/191461 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang cebb5aa0 2014-04-07T14:13:40 Fix warnings about unreferenced local variables. BUG=angleproject:602 Change-Id: I2eb04fe6eed60b3877b14628e81c0b1fe3b68647 Reviewed-on: https://chromium-review.googlesource.com/193431 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill 8b4f8f84 2014-03-26T14:01:58 Fix D3D11 resource leaks. A few bugs, like missing destructors or Release calls were leaking D3D resources in a few places on exit. This patch should fix all the unreleased D3D object warnings on exit when running a sample app. BUG=angle:589 Change-Id: Ib50df3229998938cddc2859d6f2d19ddd3a4db47 Reviewed-on: https://chromium-review.googlesource.com/190079 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 48dcae7b 2014-02-05T16:28:24 Added transform feedback shader generation. BUG=angle:495 Change-Id: I41a0177fd3eb43c9f4ab9e54faeadac3eb483c2c Reviewed-on: https://chromium-review.googlesource.com/185035 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3b7e205c 2014-03-17T09:47:43 Fix matrix input attributes and formats. We can't assume we have a simple mapping between input attribs and shader attribs. The app specifies matrix input attribs as several vector inputs, while the shader uses a single matrix type. BUG=angle:576 Change-Id: I4e3cdde4a14a5f06b86052dfe0325113cbe8e599 Reviewed-on: https://chromium-review.googlesource.com/189193 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens 0027fa9f 2014-02-20T14:26:42 Emulate integer cube texture sampling as an array of six 2D textures. BUG=angle:525 Change-Id: I3c3ec2cecebf9e745f0c02a132433e3076a6fdea Reviewed-on: https://chromium-review.googlesource.com/187534 Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c5ede1a7 2014-02-14T16:41:27 Add logic for inserting vertex conversion code in HLSL. The patch refactors the vertex input HLSL to allow for dynamic conversion in the future. Using a placehold keyword, the code replaces that stub with the vertex input conversion logic. BUG=angle:560 Change-Id: I100c50cb4decd45b0f0c10d7c2c22583368b773e Reviewed-on: https://chromium-review.googlesource.com/185194 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2c7d84ac 2014-02-14T16:41:26 Store un-linked shader attributes in ProgramBinary. Our caching of compiled vertex shaders according to their input signature needs a consistent input signature to match up shaders. Since the linking step currently shuffles attributes according to API specified locations we need a separate list. BUG=angle:560 Change-Id: Icc4d5df1d37ae895d5c882b86e60f05b5c268461 Reviewed-on: https://chromium-review.googlesource.com/185193 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c5a83000 2014-02-14T16:41:25 Store multiple vertex executables in the program binary. With dynamic vertex conversion the GPU, we will have different input layouts resulting in different executables. This patch adds a way of mapping the input layouts to vertex executables. BUG=angle:560 Change-Id: Ie36f2f8ac2dfcb96f562af577d31f57d6d89b447 Reviewed-on: https://chromium-review.googlesource.com/185192 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5f562735 2014-02-14T16:41:24 Moved all HLSL-related code from ProgramBinary to DynamicHLSL. DynamicHLSL encapsulates all HLSL generation we need outside the the shader translator, such as for linking between input and output stages and point sprite geometry shaders. BUG=angle:560 Change-Id: Ib5079aa102000a7c37b166bcbe26b09cc82f8932 Reviewed-on: https://chromium-review.googlesource.com/185191 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0aa84f63 2014-02-13T13:17:23 Merge 'Tie program binary version to commit hash.' Port changes from master branch with commit hash embedding to the development branch. BUG=angle:529 Change-Id: I307bf44103913aaaeb875a2e3ade1fab77838c48 Reviewed-on: https://chromium-review.googlesource.com/186390 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8ff21aea 2014-02-04T16:04:05 Move storage for uniform blocks to the program binary. With dynamic shaders we may have multiple shader executables per program binary. We must store the uniforms outside the executable, in the program binary, to be consistent between variations. Change-Id: I1b29a5d78c72dede8562d4878569b609536ba074 Reviewed-on: https://chromium-review.googlesource.com/183586 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 03181abc 2013-12-18T12:56:06 Fix sorting uninitialized attribute semantics to the end. A missing condition would produce a sort order where sometimes -1 was shifted to the front of the semantic array, instead of the end. BUG=angle:527 Change-Id: I69b2e5ccc03f6523771601cd59293d6cd325be2f Reviewed-on: https://chromium-review.googlesource.com/180651 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 049108df 2013-11-19T10:41:49 Include the current commit as part of the build process. BUG=angle:529 Change-Id: I6d1d227b495e9bae6e017c88642679210c6d2355 Reviewed-on: https://chromium-review.googlesource.com/177233 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Commit-Queue: Shannon Woods <shannonwoods@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill 3c9eeb97 2013-11-04T11:09:26 Disable optimizations for shaders with conditional discard in D3D9, and only use expanded short-circuiting conditionals for expressions with potential side-effects. Conservatively assume aggreate and selection operators have side effects for now. BUG= ANGLEBUG=486 R=geofflang@chromium.org, kbr@chromium.org, nicolas@transgaming.com, shannonwoods@chromium.org Review URL: https://codereview.appspot.com/14441075 Conflicts: src/common/version.h src/compiler/translator.vcxproj src/compiler/translator.vcxproj.filters src/compiler/translator/OutputHLSL.cpp src/libGLESv2/ProgramBinary.cpp src/libGLESv2/Shader.cpp src/libGLESv2/Shader.h Change-Id: Iaf9f10b5de7b33c927ef032f3c4fe9d5095f64dd
Jamie Madill fcef3366 2013-11-13T19:37:19 Fix bug with nested struct uniforms. TRAC #22875 Change-Id: I204cea18a710f6b9206a578a69f1dbc1e13fbd71 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang
Jamie Madill f07558ac 2013-10-31T11:16:22 Fix glGetUniform for non-square matrices. TRAC #22846 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang
Geoff Lang 17732823 2013-08-29T13:46:49 Moved the compiler source files into directories based on their project and added a compiler.gypi to generate the compiler projects.
Al Patrick 3f2daa89 2013-08-07T12:58:57 Presort reverse mapping of ProgramBinary::mSemanticIndex.
Jamie Madill 5609378d 2013-08-30T13:21:11 Add full support for uniform structs. TRAC #23750 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Jamie Madill 5b085dc3 2013-08-30T13:21:11 Add a field to uniforms to track which element within a register the uniform should be uploaded to. This is necessary to support HLSL-backed uniform structs. TRAC #23750 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Jamie Madill 28167c62 2013-08-30T13:21:10 Add support for struct varyings, and more robust varying link validation. TRAC #23749 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Jamie Madill c2141fb3 2013-08-30T13:21:08 Consolidate the register counting functions to a single location in the HLSL layout encoder source. This new method explicitly depends on HLSL packing rules, instead of a GL idiom. TRAC #23748 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Jamie Madill a6da33a1 2013-08-30T13:21:07 Remove the gl::Varying class, and replace all usages with sh::Varying. TRAC #23746 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods
Jamie Madill 139b9091 2013-08-30T13:21:06 Simplify the gl::Varying struct to be more like sh::Varying. The subsequent patches will remove gl::Varying entirely. TRAC #23746 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods
Jamie Madill ce79dda1 2013-08-30T13:21:06 Change the varyings list type from a linked list to a vector type. TRAC #23746 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods
Jamie Madill 9d2ffb1d 2013-08-30T13:21:04 Refactor sh::Uniform and sh::ShaderVariable into a shader variable base type with different child types. This change gives us better memory usage (many fields are unnecessary in different types) with better static typing and clear type abstraction for specific methods that might take Attributes or Varyings, etc. TRAC #23754 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods
Jamie Madill 9060a4e0 2013-08-12T16:22:57 Fix some missing UBO qualifier link validation errors. TRAC #23747 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods
Nicolas Capens cb127d3d 2013-07-15T17:26:18 Create the HLSL shadow texture function. TRAC #23394 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
Nicolas Capens 43e8ba8a 2013-07-09T10:35:15 Support 3D textures. TRAC #23472 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Nicolas Capens
Nicolas Capens e6050884 2013-07-08T10:43:10 Handle new sampler types. TRAC #23472 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Nicolas Capens
Jamie Madill 2aeb26a4 2013-07-08T14:02:55 Added support for EXT_frag_depth This change also required that support be added for associating built-in variables with an extension, similar to how functions could be associated with extensions previously. R=alokp@chromium.org Review URL: https://codereview.appspot.com/9827044 git-svn-id: https://angleproject.googlecode.com/svn/trunk@2248 736b8ea6-26fd-11df-bfd4-992fa37f6226 TRAC #23333 Authored-by: bajones@chromium.org Signed-off-by: Shannon Woods Signed-off-by Nicolas Capens Merged-by: Jamie Madill
Jamie Madill 87939710 2013-07-02T11:57:01 Move VertexAttribute to its own header file. This is in preparation for VAO support. TRAC #23390 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Authored-by: Jamie Madill
Jamie Madill 6fb09f6c 2013-06-21T09:15:31 Fix a typo when reporting too many interface blocks in a fragment program. TRAC #23326 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
Jamie Madill d1ac3c90 2013-06-25T10:40:30 Move the D3DCompile call to after the check for API link errors. This avoids producing unhelpful internal D3D errors. TRAC #23326 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
Jamie Madill b4e664b1 2013-06-20T11:55:54 Alter array instanced uniform buffer objects to use direct references to HLSL constant buffers. This avoids using a shader scoped static storage buffer, with copies. TRAC #23299 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
Jamie Madill 010fffa8 2013-06-20T11:55:53 Pass matrix packing qualifier data back from the shader translator to the GLES API. TRAC #23271 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
Jamie Madill eba4eff5 2013-06-20T11:55:51 Add support for specifying locations of vertex inputs using layout qualifiers, for GLSL ES 3.00. TRAC #23269 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens Authored-by: Jamie Madill