1. 11 Feb, 2016 4 commits
    • Implemented instanced rendering for emulated point sprites · 534bf87b
      Cooper Partin authored
      Non-instanced PointSprite emulation for lower feature levels is
      implemented using D3D DrawIndexedInstanced and an instanced vertex
      buffer containing a pointsprite quad.
      
      GL instanced rendering using glDrawArraysInstanced and
      glDrawElementsInstanced with pointsprite emulation is performed using
      a for-loop.  The loop iterates over each instance to render and adjusts
      the buffer offsets accordingly. This is not performant and is only used
      and required by this chosen pointsprite emulation method.
      
      Indexed instanced (glDrawElementsInstanced), uses the same offset loop
      because the vertex buffer containing the data to be rendered has already
      been expanded using getEmulatedIndexedBuffer().  Expanding the buffer
      makes the two rendering operations similar enough to share code.
      
      BUG=angleproject:1279
      TEST=angle_end2end_tests
      
      Change-Id: If46cc9f158e29f5518c70ad630b3228f474a9f8b
      Reviewed-on: https://chromium-review.googlesource.com/321407Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
      Commit-Queue: Geoff Lang <geofflang@chromium.org>
    • D3D11: Add a test to cover a clear RTV driver bug. · cfd6b2b6
      Jamie Madill authored
      See dEQP-GLES3.functional.fbo.color.repeated_clear.sample.tex2d.rgba8
      
      This test uses ClearRenderTargetView to clear various FBO textures,
      but it does not seem to work correctly on my Nvidia configuration.
      It has been reported to Nvidia. It also seems to fail on Intel.
      
      Current GPU: NVIDIA GeForce GTX 660
      Current Driver: 10.18.13.5598 (9-13-2015)
      Works on Desktop OpenGL back-end, also on AMD R5230
      
      BUG=angleproject:1305
      
      Change-Id: I4b53b7376faf71f234d05c90f4fb55462de23e36
      Reviewed-on: https://chromium-review.googlesource.com/314304Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
      Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
      Commit-Queue: Jamie Madill <jmadill@chromium.org>
    • Fix texture swizzle cache initialization · ee991799
      Olli Etuaho authored
      Texture swizzle cache needs to be initialized so that the keys do not
      represent a valid swizzle state before any swizzled textures have been
      cached.
      
      BUG=angleproject:1095
      TEST=dEQP-GLES3.functional.texture.swizzle.* (all pass)
      
      Change-Id: I66c10ed49134875d29b07852488a41a776e8fb67
      Reviewed-on: https://chromium-review.googlesource.com/326971Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
      Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
      Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    • Avoid a copy in TextureStorage11::setData · 0ecb18b9
      John Bauman authored
      This is essentially a reland of 9cf9bcbe
      
      This code always allocates a new memory buffer for the texture memory,
      picks a load function to copy/convert the input data into it, and the
      uploads.
      
      In the case where the input format matches the upload format we should
      be able to skip the allocation and copy and be much happier.
      
      Change-Id: If4281aeb4cd7bbbebba60122a10610a916833052
      Reviewed-on: https://chromium-review.googlesource.com/326852
      Tryjob-Request: John Bauman <jbauman@chromium.org>
      Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
      Commit-Queue: John Bauman <jbauman@chromium.org>
  2. 10 Feb, 2016 1 commit
  3. 09 Feb, 2016 9 commits
  4. 08 Feb, 2016 5 commits
    • Replace '> >' with '>>' · 1eabcf41
      Corentin Wallez authored
      BUG=angleproject:1308
      
      Change-Id: I00bd2ea939b633817662205eb7879efb7f99965f
      Reviewed-on: https://chromium-review.googlesource.com/326400Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
      Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
    • Re-land "Implement EGL_experimental_present_path_angle" · 2a63b3f8
      Austin Kinross authored
      - Re-land with clang fix.
      
      This allows ANGLE to render directly onto a D3D swapchain in the correct
      orientation when using the D3D11 renderer.
      
      The trick is to add an extra uniform to each shader which takes either
      the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this
      value to -1.0. When rendering to the default framebuffer, ANGLE sets
      this value to +1.0. ANGLE multiplies vertex positions by this value in
      the VS to invert rendering when appropriate. It also corrects other
      state (e.g. viewport/scissor rect) and shader built-in values
      (e.g. gl_FragCoord).
      
      This saves a substantial amount of GPU time and lowers power
      consumption. For example, the old method (where ANGLE renders all
      content onto an offscreen texture, and then copies/inverts this onto the
      swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame
      on a Lumia 630.
      
      Verification:
      + dEQP GL ES2 tests pass when "present path fast" is enabled
      + all ANGLE_end2end_tests pass when "present path fast" is enabled
      
      BUG=angleproject:1219
      
      Change-Id: I56b339897828753a616d7bae837a2f354dba9c63
      Reviewed-on: https://chromium-review.googlesource.com/326730
      Tryjob-Request: Austin Kinross <aukinros@microsoft.com>
      Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
      Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
    • D3D11: Refactor RenderTarget apply into StateManager11. · c9bdeff4
      Jamie Madill authored
      This is a refactoring patch only, and doesn't change the behaviour.
      The intent is to make it easy to turn on the Framebuffer dirty bits
      in a subsequent patch, once we can cleanly handle textures and
      renderbuffers getting recreated.
      
      BUG=angleproject:1260
      
      Change-Id: Iaa5cfe222b020724e088eee5f1ae909b6f981a08
      Reviewed-on: https://chromium-review.googlesource.com/325423Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
      Commit-Queue: Jamie Madill <jmadill@chromium.org>
    • Download GN in the gclient hooks. · 570f67d7
      Corentin Wallez authored
      Recently git cl format has started requiring GN and would fail when run
      in the ANGLE standalone repository because the binary was not present.
      
      BUG=
      
      Change-Id: I0482db6fd6a868dc02ef6e395e6ff4817623c291
      Reviewed-on: https://chromium-review.googlesource.com/326420Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
      Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
      Commit-Queue: Corentin Wallez <cwallez@chromium.org>
    • Revert "Implement EGL_experimental_present_path_angle" · d1c46228
      Jamie Madill authored
      Compile failure on Clang/Win:
      
      The reason for reverting is: FAILED: ninja -t msvc -e environment.x86 --
      "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo
      /showIncludes /FC
      @obj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj.rsp
      /c ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp
      /Foobj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj
      /Fdobj\gpu\angle_end2end_tests.cc.pdb 
      In file included from
      ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp:7:
      In file included from
      ..\..\third_party\angle\src\tests\test_utils/ANGLETest.h:13:
      ..\..\testing\gtest\include\gtest/gtest.h(1392,16) :  error: comparison of
      integers of different signs: 'const int' and 'const unsigned int'
      [-Werror,-Wsign-compare]
        if (expected == actual) {
            ~~~~~~~~ ^  ~~~~~~
      ..\..\testing\gtest\include\gtest/gtest.h(1422,12) :  note: in instantiation of
      function template specialization 'testing::internal::CmpHelperEQ<int, unsigned
      int>' requested here
          return CmpHelperEQ(expected_expression, actual_expression, expected,
                 ^
      ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp(281,9) :
       note: in instantiation of function template specialization
      'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here
              ASSERT_EQ(mWindowWidth * 4, mappedSubresource.RowPitch);
              ^
      ..\..\testing\gtest\include\gtest/gtest.h(1960,32) :  note: expanded from macro
      'ASSERT_EQ'
      # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
                                     ^
      ..\..\testing\gtest\include\gtest/gtest.h(1943,67) :  note: expanded from macro
      'GTEST_ASSERT_EQ'
                            EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
                                                                        ^
      
      BUG=angleproject:1219
      
      This reverts commit 6b3c1db5.
      
      Change-Id: Ia67ab82dd13295dc03235d57fa417c73f20a49e6
      Reviewed-on: https://chromium-review.googlesource.com/326680Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
  5. 06 Feb, 2016 2 commits
    • Refactor InputLayoutCache::applyVertexBuffers. · c674abeb
      Jamie Madill authored
      The redesigned code places the internal buffers and input elements for
      instance point sprite emulation (FL9_3) at the start of the arrays,
      instead of swapping with the first non-instanced element. This makes
      the tracking logic of the caching somewhat cleaner.
      
      This facilitates the work of implementing instancing-on-instancing for
      FL9_3 conformance.
      
      BUG=angleproject:1279
      
      Change-Id: Ifb030816a313b1e8b916c57ef05915914443312a
      Reviewed-on: https://chromium-review.googlesource.com/325090Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
      Commit-Queue: Jamie Madill <jmadill@chromium.org>
    • Revert "Avoid a copy in TextureStorage11::setData" · 3a913264
      Jamie Madill authored
      Fails on the Windows builders:
      
      https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Builder/builds/42201
      
      e:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\libangle\renderer\d3d\d3d11\load_functions_table_autogen.cpp(787) : error C2440: 'return' : cannot convert from 'const std::map<GLenum,rx::LoadImageFunction,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' to 'const std::map<GLenum,rx::d3d11::LoadImageFunctionInfo,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>> &'
              with
              [
                  _Kty=GLuint
      ,            _Ty=rx::LoadImageFunction
              ]
              and
              [
                  _Kty=GLuint
      ,            _Ty=rx::d3d11::LoadImageFunctionInfo
              ]
              Reason: cannot convert from 'const std::map<GLenum,rx::LoadImageFunction,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' to 'const std::map<GLenum,rx::d3d11::LoadImageFunctionInfo,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>'
              with
              [
                  _Kty=GLuint
      ,            _Ty=rx::LoadImageFunction
              ]
              and
              [
                  _Kty=GLuint
      ,            _Ty=rx::d3d11::LoadImageFunctionInfo
              ]
              No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
      
      This reverts commit 52d3e43b.
      
      Change-Id: I83774ea09ccbb2b92ff609714e1c7201beb775bc
      Reviewed-on: https://chromium-review.googlesource.com/326540Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
  6. 05 Feb, 2016 7 commits
  7. 03 Feb, 2016 3 commits
  8. 02 Feb, 2016 7 commits
  9. 01 Feb, 2016 2 commits
    • Redesign samplers in shaders on D3D11 · 9b4e8626
      Olli Etuaho authored
      Translation of samplers to HLSL on D3D11 is changed as follows:
      
      Instead of passing around HLSL sampler and HLSL texture references in
      shaders, all references to ESSL samplers are converted to constant
      indices within the shader body. Each ESSL sampler is identified by an
      unique index. In the code generated to implement ESSL texture functions,
      these indices are used to index arrays of HLSL samplers and HLSL
      textures to get the sampler and texture to use.
      
      HLSL textures and samplers are grouped into arrays by their types. Each
      unique combination of a HLSL texture type + HLSL sampler type gets its
      own array. To convert a unique sampler index to an index to one of these
      arrays, a constant offset is applied. In the most common case of a 2D
      texture and a regular (non-comparison) sampler, the index offset is
      always zero and is omitted.
      
      The end goal of this refactoring is to make adding extra metadata for
      samplers easier. The unique sampler index can be used in follow-up
      changes to index an array of metadata passed in uniforms, which can
      contain such things as the base level of the texture.
      
      This does not solve the issues with samplers in structs.
      
      The interface from the point of view of libANGLE is still exactly the
      same, the only thing that changes is how samplers are handled inside the
      shader.
      
      On feature level 9_3, the D3D compiler has a bug where it can report that
      the maximum sampler index is exceeded when in fact it is not. This can
      happen when an array of samplers is declared in the shader. Because of
      this the new approach can't be used on D3D11 feature level 9_3, but it
      will continue using the old approach instead.
      
      BUG=angleproject:1261
      TEST=angle_end2end_tests,
           dEQP-GLES3.functional.shaders.texture_functions.* (no regressions)
           dEQP-GLES3.functional.texture.units.* (no regressions)
      
      Change-Id: I5fbb0c4280000202dc2795a628b56bd8194ef96f
      Reviewed-on: https://chromium-review.googlesource.com/320571Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
      Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
      Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
      Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
      Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
    • Fix leak with binding Framebuffers directly. · 5bf9ff4a
      Jamie Madill authored
      Using BindFramebuffer(1) then GenFramebuffers would return 1.
      This leads to a memory leak and was something that was obscuring
      debugging a bug in my ReadPixels fix for ES3.
      
      This also fixes a bug where running the texture tests along produces
      some random failures.
      
      BUG=angleproject:1290
      BUG=angleproject:1299
      
      Change-Id: If11e8c743d2ddde725b12749ac012f670cd290e1
      Reviewed-on: https://chromium-review.googlesource.com/324820Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
      Commit-Queue: Jamie Madill <jmadill@chromium.org>
      Tested-by: 's avatarJamie Madill <jmadill@chromium.org>