src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp


Log

Author Commit Date CI Message
Jamie Madill 8415b5fd 2016-04-26T13:41:39 Pass ContextImpl to Framebuffer methods instead of ContextState. BUG=angleproject:1363 Change-Id: I7e7524d95f2ca31c35918f9fe5c0cb681ed93616 Reviewed-on: https://chromium-review.googlesource.com/340746 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 250062bc 2016-04-25T12:33:44 Make sure D3DRS_TWOSIDEDSTENCILMODE is enabled if the stencil test is. This state-setting code was not ported when adding the dirty bits for D3D9 depth stencil state in https://chromium-review.googlesource.com/#/c/316449. BUG=597107 Change-Id: I0a1bdae18dd22c9b01f12a73267040157a866654 Reviewed-on: https://chromium-review.googlesource.com/340436 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang ae2d0a0e 2016-04-15T15:04:14 Fix incorrect dirty bit state tracking on D3D9 AMD with color masks. When using the zero color mask workaround in StateManager9, the blend state and blend equation were being modified. This caused inconsistant state if the workaround stopped being used in subsequent draw calls. To deal with this issue, dirty the BLEND_ENABLED and BLEND_EQUATION states when the COLOR_MASK changes and dirty the COLOR_MASK state wheneither BLEND_ENABLED or BLEND_EQUATION changes. BUG=597107 Change-Id: I03de934b419b7593e4863838720ced1e5773c092 Reviewed-on: https://chromium-review.googlesource.com/339280 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Geoff Lang <geofflang@chromium.org>
Austin Kinross 2a63b3f8 2016-02-08T12:29:08 Re-land "Implement EGL_experimental_present_path_angle" - 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: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d1c46228 2016-02-08T14:51:18 Revert "Implement EGL_experimental_present_path_angle" 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 6b3c1db5170450bbc4946d8f18ba0d8619da43a0. Change-Id: Ia67ab82dd13295dc03235d57fa417c73f20a49e6 Reviewed-on: https://chromium-review.googlesource.com/326680 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 6b3c1db5 2015-12-18T14:01:46 Implement EGL_experimental_present_path_angle 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: Ib6eeea46bafa6ebce4adada0ae9db3a433b8fc4c Reviewed-on: https://chromium-review.googlesource.com/321360 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill c9d442d7 2016-01-20T11:17:24 Sync dirty objects at the GL layer. The dirty bit system currently puts dirty objects in line with the rest of the dirty state. This means at the Renderer level, the sync manager code would call back to the GL layer to sync the specific objects that are dirty. This is a bit of a layering violation (impl layer mutating top-level objects) and also a bit of repeated boiler- plate code. Fix this by treating dirty objects in a separate dirty bit set, called the dirty objects. This also has the benefit of allowing us to re- implement the dirty object set at a later date, if we want to store them in a list, or other structure. Also don't skip the state sync at the GL level if there are no GL dirty bits. The Impl might have some dirty bits locally, and it's better to call syncState and do the no-op check in the Impl than it is to also sync local state at every sync point (draw call, read, etc) in each Impl. BUG=angleproject:1260 Change-Id: Id5d4beb2a1c4e3ad351edf54e3f32e828d5f5da3 Reviewed-on: https://chromium-review.googlesource.com/318790 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dian Xiang 5aeed4cc 2015-12-09T13:36:43 Using dirty bit notification for D3D9 viewport state BUG=angleproject:1249 This is a continuation of D3D dirty bit refactor for D3D9 performance enhancements Change-Id: Iedd7eb003981cac7f81a58560cb326760f01c06a Reviewed-on: https://chromium-review.googlesource.com/317313 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Dian Xiang <dianx@google.com> Tested-by: Jamie Madill <jmadill@chromium.org>
Dian Xiang a8893120 2015-12-08T16:37:21 Using dirty bit notification for D3D9 scissor state BUG=angleproject:1249 This is a continuation of D3D dirty bit refactor for D3D9 performance enhancements Change-Id: I480bb95414a1baf71e7768a1704b34ae55244ed1 Reviewed-on: https://chromium-review.googlesource.com/316917 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Dian Xiang <dianx@google.com>
Dian Xiang 6ae40ea5 2015-12-07T20:15:28 Using dirty bits notification for D3D9 depth stencil state BUG=angleproject:1249 This is a continuation of the D3D dirty bit refactor for D3D9 for performance enhancements Change-Id: I8690d47999b73483c47f4994dc46cd97f4ced63d Reviewed-on: https://chromium-review.googlesource.com/316449 Tryjob-Request: Dian Xiang <dianx@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Dian Xiang <dianx@google.com>
Dian Xiang c660ba8e 2015-12-07T22:42:33 Using dirty bit notification for D3D9 rasterizer state BUG=angleproject:1249 Continuation of refactor for d3d9 dirty bit refactor for performance enhancements Change-Id: I414cc9bfbdc806d870a9f208895f411edf5adcf3 Reviewed-on: https://chromium-review.googlesource.com/316515 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Dian Xiang <dianx@google.com>
Dian Xiang 3e03ebd6 2015-12-07T13:15:10 Using dirty bits notification for D3D9 blend state BUG=angleproject:1249 Dirty bit notifications are used in GL and D3D11 for state tracking. This is a continuation of D3D dirty bit refactor for D3D9 Change-Id: Ifaa1826a93cf36c83d68150107b164d1d269c2b0 Reviewed-on: https://chromium-review.googlesource.com/316475 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Dian Xiang <dianx@google.com> Tested-by: Dian Xiang <dianx@google.com>
Jamie Madill 63e4e724 2015-11-06T19:15:11 Revert "Using dirty bits notification for blend state" Failing the dEQP-GLES3 tests: http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20dEQP%20%28NVIDIA%29/builds/4036/ 3 tests failed: dEQP_GLES3.Default/functional_multisample_fbo_4_samples_sample_coverage_invert (c:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\tests\deqp_support\angle_deqp_gtest.cpp:234) dEQP_GLES3.Default/functional_multisample_fbo_8_samples_sample_coverage_invert (c:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\tests\deqp_support\angle_deqp_gtest.cpp:234) dEQP_GLES3.Default/functional_multisample_fbo_max_samples_sample_coverage_invert (c:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\tests\deqp_support\angle_deqp_gtest.cpp:234) BUG=angleproject:1161 This reverts commit ff2ab571b00023926ce39a91bfe20e13578d1281. Change-Id: Ibf61fc2c64ffc31778645bfe0292516b1f107397 Reviewed-on: https://chromium-review.googlesource.com/311243 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dian Xiang ff2ab571 2015-10-05T16:48:06 Using dirty bits notification for blend state BUG=angleproject:1161 Dirty bit notifications are used in GL for state tracking, but not D3D. Before, D3D would use memcmp to check a change in state for every call. This showed up as a hot spot in the perf test runs. Hence, switching D3D over to the dirty bit system similar to GL backend will help. Change-Id: I482edc852f1dcc888af3038ff3a61916496a02bc Reviewed-on: https://chromium-review.googlesource.com/305295 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Dian Xiang <dianx@google.com> Tested-by: Jamie Madill <jmadill@chromium.org>