src/libGLESv2/DynamicHLSL.cpp


Log

Author Commit Date CI Message
Jamie Madill d5512cd4 2014-07-10T17:50:08 Collect shader outputs and interface block information. This paves the way for returning ES3-specific info from the shader translator with the new query methods. BUG=angle:466 Change-Id: Ib13cdb604854cdf11e9dc00dd94f18eadc946561 Reviewed-on: https://chromium-review.googlesource.com/206770 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Geoff Lang c0b9ef4b 2014-07-02T10:02:37 Split Caps into Caps, Extensions and TextureFormatCaps. Context now holds it's own Caps, Extensions and TextureFormat caps so that it can modify them based on client version or work-arounds. BUG=angle:658 Change-Id: Id71b6c89b7aa36e1f3dc42b0e4720eaed1851fb9 Reviewed-on: https://chromium-review.googlesource.com/206480 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang aae65a4e 2014-05-26T12:43:44 Add caps for texture size limits and other caps in the 6.28 table. BUG=angle:658 Change-Id: Ia265fe1d3713db7701b41e8430d6d186f352ab4a Reviewed-on: https://chromium-review.googlesource.com/201363 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 53cb14dc 2014-07-08T15:02:35 Share ArrayString and Str helper methods. Placing these string helper methods allows us to re-use them in the relevant place of the shader translator. BUG=angle:466 Change-Id: Idd638542027d3b1035bc79fc941e80bf436c82af Reviewed-on: https://chromium-review.googlesource.com/206567 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@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 febb7adc 2014-06-18T13:50:51 Refactor and unify HLSL varying signatures. We would use different code for all of our input and ouput stages in HLSL (vertex output, GS input, GS output, PS input). This was causing an HLSL error and some bugs in certain transform feedback instances. Fix this by using a helper method to use compatible code for each of the stages. BUG=angle:667 Change-Id: Idada969a775eccb5788723e0c7fa3ade9cb2d9ec Reviewed-on: https://chromium-review.googlesource.com/203778 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Geoff Lang 4ace423c 2014-06-18T19:12:48 Disable dynamic pixel shader generation. Always generate the same pixel shader no matter what framebuffer is bound. BUG=angle:670 Change-Id: I3fa91ff43363d49b38a19d3815ea523946c675d5 Reviewed-on: https://chromium-review.googlesource.com/204573 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 033dae67 2014-06-18T12:56:28 Move OutputHLSL utility methods to other files. OutputHLSL was become a large, unweildy file. Some were also useful to other classes, even on the GL back-end, but were inacessible. Refactoring patch only. BUG=angle:466 Change-Id: Id216147122ca105c6ccdf0ba0c5f6c5038726965 Reviewed-on: https://chromium-review.googlesource.com/203459 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2bf8b372 2014-06-16T17:18:51 Fix link error when using varyings with "dx_". Varyings beginning with "dx_" would not get decorated properly, or at all, which could cause potential internal variables and certainly caused link errors. Fix this by no longer treating the "dx_" prefix differently. Also fix our naming of "dx_Position" to be consistent with our other internal types. BUG=angle:678 Change-Id: I03da0494a3d934d82ae7b3f8f12a576ff9bc3869 Reviewed-on: https://chromium-review.googlesource.com/203777 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@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 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>
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>
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>
Geoff Lang b5b02857 2014-04-16T14:39:36 Fix a semantic index not being written for gl_FragCoord. BUG=angle:608 Change-Id: Iebf7577a7a0c54cef25cfa7706840e8ad26b7a08 Reviewed-on: https://chromium-review.googlesource.com/195163 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Geoff Lang <geofflang@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 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 a53ab517 2014-03-17T09:47:44 Fix linking of struct varyings. The dEQP varying struct linkage tests were triggering asserts when we tried to query component info of struct types. BUG=angle:580 Change-Id: I61e33573c5577a327c58fec7a07ae7718690ac42 Reviewed-on: https://chromium-review.googlesource.com/189194 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@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>
Jamie Madill 8664b063 2014-02-14T16:41:29 Add logic for dynamic converstion of int to float vertex data. We can use the format tables and input layout to determine when we need to generate conversion code in the vertex shader. BUG=angle:560 Change-Id: Ib64fb16823bf78ed6432fba283b0d24bcb673a76 Reviewed-on: https://chromium-review.googlesource.com/185195 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-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 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>