summaryrefslogtreecommitdiff
path: root/chromium/third_party/swiftshader
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-09-18 14:34:04 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-10-04 11:15:27 +0000
commite6430e577f105ad8813c92e75c54660c4985026e (patch)
tree88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/third_party/swiftshader
parent53d399fe6415a96ea6986ec0d402a9c07da72453 (diff)
downloadqtwebengine-chromium-e6430e577f105ad8813c92e75c54660c4985026e.tar.gz
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/third_party/swiftshader')
-rw-r--r--chromium/third_party/swiftshader/.travis.yml19
-rw-r--r--chromium/third_party/swiftshader/BUILD.gn8
-rw-r--r--chromium/third_party/swiftshader/CMakeLists.txt14
-rw-r--r--chromium/third_party/swiftshader/OWNERS8
-rw-r--r--chromium/third_party/swiftshader/README.md21
-rw-r--r--chromium/third_party/swiftshader/SwiftShader.sln15
-rw-r--r--chromium/third_party/swiftshader/docs/Index.md2
-rw-r--r--chromium/third_party/swiftshader/docs/Subzero.md19
-rw-r--r--chromium/third_party/swiftshader/extensions/CHROMIUM_texture_filtering_hint.txt85
-rw-r--r--chromium/third_party/swiftshader/src/Android.mk8
-rw-r--r--chromium/third_party/swiftshader/src/Common/GrallocAndroid.cpp19
-rw-r--r--chromium/third_party/swiftshader/src/Common/GrallocAndroid.hpp62
-rw-r--r--chromium/third_party/swiftshader/src/Common/Memory.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/Common/Memory.hpp1
-rw-r--r--chromium/third_party/swiftshader/src/Common/Resource.cpp2
-rw-r--r--chromium/third_party/swiftshader/src/Common/SharedLibrary.hpp6
-rw-r--r--chromium/third_party/swiftshader/src/Common/Thread.hpp16
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3D8.hpp34
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.cpp2
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.hpp30
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DCubeTexture8.hpp40
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.cpp95
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.hpp199
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DIndexBuffer8.hpp32
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DPixelShader8.hpp9
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DResource8.hpp24
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DStateBlock8.hpp13
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.hpp28
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DSwapChain8.hpp14
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DTexture8.hpp42
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DVertexBuffer8.hpp30
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DVertexDeclaration8.hpp8
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DVertexShader8.hpp8
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.hpp28
-rw-r--r--chromium/third_party/swiftshader/src/D3D8/Direct3DVolumeTexture8.hpp40
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3D9.hpp36
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3D9Ex.hpp46
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DBaseTexture9.hpp36
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DCubeTexture9.hpp46
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.cpp2
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.hpp240
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9Ex.hpp272
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DIndexBuffer9.hpp32
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DPixelShader9.hpp12
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DQuery9.hpp18
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DResource9.hpp24
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DStateBlock9.hpp14
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.hpp40
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DSwapChain9.hpp22
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DTexture9.hpp48
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DVertexBuffer9.hpp30
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DVertexDeclaration9.hpp14
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DVertexShader9.hpp12
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.hpp28
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Direct3DVolumeTexture9.hpp46
-rw-r--r--chromium/third_party/swiftshader/src/D3D9/Unknown.hpp6
-rw-r--r--chromium/third_party/swiftshader/src/Main/Config.hpp2
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBuffer.cpp1
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBuffer.hpp4
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.cpp11
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.hpp3
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferDD.hpp2
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferGDI.hpp4
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferWin.hpp2
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferX11.cpp4
-rw-r--r--chromium/third_party/swiftshader/src/Main/FrameBufferX11.hpp6
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/common/Image.cpp85
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/common/Image.hpp45
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/common/Object.cpp4
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/common/Object.hpp2
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/common/Surface.hpp52
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.cpp61
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.h1
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/compiler/SymbolTable.cpp2
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/Android.mk8
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn37
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/Context.hpp14
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.cpp24
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.h11
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/Surface.cpp (renamed from chromium/third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.cpp)23
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/Surface.hpp (renamed from chromium/third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.h)32
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/TypeInfo.cpp28
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/exports.map9
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp38
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp4
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj5
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj.filters7
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/main.cpp55
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libEGL/main.h12
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGL/Image.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGL/Image.hpp5
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Android.mk6
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.cpp11
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.h18
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Device.cpp4
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.cpp45
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.h60
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.cpp4
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp4
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/main.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Android.mk6
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn25
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.cpp85
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.h16
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Device.cpp4
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.cpp164
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.h61
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.cpp118
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.h147
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/TypeInfo.cpp22
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/VertexDataManager.cpp2
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/exports.map555
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.cpp17
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp8
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj1
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj.filters3
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv3.cpp13
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/main.cpp10
-rw-r--r--chromium/third_party/swiftshader/src/OpenGL/libGLESv2/utilities.cpp16
-rw-r--r--chromium/third_party/swiftshader/src/Reactor/LLVMReactor.cpp16
-rw-r--r--chromium/third_party/swiftshader/src/Reactor/Reactor.hpp2
-rw-r--r--chromium/third_party/swiftshader/src/Reactor/SubzeroReactor.cpp37
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Blitter.cpp7
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Blitter.hpp3
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/LRUCache.hpp20
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/PixelProcessor.cpp9
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/PixelProcessor.hpp1
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Renderer.cpp48
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Renderer.hpp5
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Sampler.cpp7
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Sampler.hpp3
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Surface.cpp49
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/Surface.hpp24
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/VertexProcessor.cpp9
-rw-r--r--chromium/third_party/swiftshader/src/Renderer/VertexProcessor.hpp1
-rw-r--r--chromium/third_party/swiftshader/src/Shader/SamplerCore.cpp203
-rw-r--r--chromium/third_party/swiftshader/src/Shader/SamplerCore.hpp1
-rw-r--r--chromium/third_party/swiftshader/src/Shader/ShaderCore.cpp8
-rw-r--r--chromium/third_party/swiftshader/tests/unittests/BUILD.gn17
-rw-r--r--chromium/third_party/swiftshader/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2/Build/OSX/Info.plist2
144 files changed, 2581 insertions, 1994 deletions
diff --git a/chromium/third_party/swiftshader/.travis.yml b/chromium/third_party/swiftshader/.travis.yml
new file mode 100644
index 00000000000..92e428f0274
--- /dev/null
+++ b/chromium/third_party/swiftshader/.travis.yml
@@ -0,0 +1,19 @@
+language: cpp
+
+os: linux
+dist: trusty
+sudo: false
+
+compiler:
+ - clang
+ - gcc
+
+env:
+ - REACTOR_BACKEND=LLVM
+ - REACTOR_BACKEND=Subzero
+
+script:
+ - $CXX --version
+ - mkdir build && cd build
+ - cmake -DREACTOR_BACKEND=$REACTOR_BACKEND ..
+ - make \ No newline at end of file
diff --git a/chromium/third_party/swiftshader/BUILD.gn b/chromium/third_party/swiftshader/BUILD.gn
index 694942a76e0..52a78e89129 100644
--- a/chromium/third_party/swiftshader/BUILD.gn
+++ b/chromium/third_party/swiftshader/BUILD.gn
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import("//build/config/compiler/compiler.gni")
+
config("swiftshader_config") {
defines = [ "STRICT_CONFORMANCE" ] # Disables OpenGL ES 3.0
@@ -87,6 +89,12 @@ config("swiftshader_config") {
"-Wl,--hash-style=both",
"-Wl,--gc-sections",
]
+ # A bug in the gold linker prevents using ICF on 32-bit (crbug.com/729532)
+ if (use_gold && target_cpu == "x86") {
+ ldflags += [
+ "-Wl,--icf=none",
+ ]
+ }
}
}
}
diff --git a/chromium/third_party/swiftshader/CMakeLists.txt b/chromium/third_party/swiftshader/CMakeLists.txt
index 9bea271a207..0841d8dc5d7 100644
--- a/chromium/third_party/swiftshader/CMakeLists.txt
+++ b/chromium/third_party/swiftshader/CMakeLists.txt
@@ -63,6 +63,8 @@ else()
endif()
endif()
+set(CMAKE_MACOSX_RPATH ON)
+
###########################################################
# Convenience macros
###########################################################
@@ -436,12 +438,6 @@ set(LLVM_LIST
${LLVM_DIR}/lib/Support/raw_os_ostream.cpp
${LLVM_DIR}/lib/Support/raw_ostream.cpp
${LLVM_DIR}/lib/Support/system_error.cpp
- ${LLVM_DIR}/lib/TableGen/Error.cpp
- ${LLVM_DIR}/lib/TableGen/Main.cpp
- ${LLVM_DIR}/lib/TableGen/Record.cpp
- ${LLVM_DIR}/lib/TableGen/TGLexer.cpp
- ${LLVM_DIR}/lib/TableGen/TGParser.cpp
- ${LLVM_DIR}/lib/TableGen/TableGenBackend.cpp
${LLVM_DIR}/lib/Target/Mangler.cpp
${LLVM_DIR}/lib/Target/TargetData.cpp
${LLVM_DIR}/lib/Target/TargetELFWriterInfo.cpp
@@ -745,9 +741,6 @@ file(GLOB_RECURSE EGL_LIST
${OPENGL_DIR}/common/debug.h
${CMAKE_SOURCE_DIR}/include/*.h
)
-# Key method definitions are only required to appease the gold linker,
-# and cause vtable linking issues with other linkers.
-list(REMOVE_ITEM EGL_LIST ${OPENGL_DIR}/libEGL/TypeInfo.cpp)
file(GLOB_RECURSE GL32_LIST
${OPENGL_DIR}/libGL/*.cpp
@@ -770,9 +763,6 @@ file(GLOB_RECURSE GLES2_LIST
${CMAKE_SOURCE_DIR}/include/GLES2/*.h
${CMAKE_SOURCE_DIR}/include/GLES3/*.h
)
-# Key method definitions are only required to appease the gold linker,
-# and cause vtable linking issues with other linkers.
-list(REMOVE_ITEM GLES2_LIST ${OPENGL_DIR}/libGLESv2/TypeInfo.cpp)
file(GLOB_RECURSE GLES_CM_LIST
${OPENGL_DIR}/libGLES_CM/*.cpp
diff --git a/chromium/third_party/swiftshader/OWNERS b/chromium/third_party/swiftshader/OWNERS
index 2c51053fe8b..7aa5e421359 100644
--- a/chromium/third_party/swiftshader/OWNERS
+++ b/chromium/third_party/swiftshader/OWNERS
@@ -1,9 +1,7 @@
# This is the list of people with commit rights actively working on SwiftShader
#
-# This list is used by Chromium to make sure that one of the owners in this
-# list has approved a SwiftShader related change before landing it
+# This list is used by Chromium and Android to make sure that one of the owners
+# in this list has approved a SwiftShader related change before landing it.
-capn@chromium.org
-capn@google.com
-sugoi@chromium.org
+nicolascapens@google.com
sugoi@google.com \ No newline at end of file
diff --git a/chromium/third_party/swiftshader/README.md b/chromium/third_party/swiftshader/README.md
index 85f88e5f86e..33860d3d6d6 100644
--- a/chromium/third_party/swiftshader/README.md
+++ b/chromium/third_party/swiftshader/README.md
@@ -1,13 +1,14 @@
-SwiftShader
-==========
+# SwiftShader [![Build Status](https://travis-ci.org/google/swiftshader.svg?branch=master)](https://travis-ci.org/google/swiftshader) [![Build status](https://ci.appveyor.com/api/projects/status/yrmyvb34j22jg1uj?svg=true)](https://ci.appveyor.com/project/c0d1f1ed/swiftshader)
+
+-----------------------------------------------------------------------------------------------------------
Introduction
------------------
+------------
SwiftShader is a high-performance CPU-based implementation of the OpenGL ES and Direct3D 9 graphics APIs<sup>1</sup><sup>2</sup>. Its goal is to provide hardware independence for advanced 3D graphics.
Usage
---------
+-----
The SwiftShader libraries act as drop-in replacements for graphics drivers.
@@ -16,7 +17,7 @@ On Windows, most applications can be made to use SwiftShader's DLLs by placing t
Prebuilt binaries can be found at: https://goo.gl/5MOcdb
Contributing
------------------
+------------
See [CONTRIBUTING.txt](CONTRIBUTING.txt) for important contributing requirements.
@@ -59,29 +60,29 @@ Documentation
See [docs/Index.md](docs/Index.md).
Contact
------------
+-------
Public mailing list: [swiftshader@googlegroups.com](https://groups.google.com/forum/#!forum/swiftshader)
Bug tracker: https://bugs.chromium.org/p/swiftshader
License
-----------
+-------
The SwiftShader project is licensed under the Apache License Version 2.0. You can find a copy of it in [LICENSE.txt](LICENSE.txt).
Files in the third_party folder are subject to their respective license.
Authors and Contributors
------------------------------------
+------------------------
The legal authors for copyright purposes are listed in [AUTHORS.txt](AUTHORS.txt).
[CONTRIBUTORS.txt](CONTRIBUTORS.txt) contains a list of names of individuals who have contributed to SwiftShader. If you're not on the list, but you've signed the [Google CLA](https://cla.developers.google.com/clas) and have contributed more than a formatting change, feel free to request to be added.
Disclaimer
----------------
+----------
1. Trademarks are the property of their respective owners.
2. We do not claim official conformance with any graphics APIs at this moment.
-3. This is not an official Google product. \ No newline at end of file
+3. This is not an official Google product.
diff --git a/chromium/third_party/swiftshader/SwiftShader.sln b/chromium/third_party/swiftshader/SwiftShader.sln
index 2baa1a8187e..c323788de3d 100644
--- a/chromium/third_party/swiftshader/SwiftShader.sln
+++ b/chromium/third_party/swiftshader/SwiftShader.sln
@@ -257,6 +257,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SubzeroTest", "src\Reactor\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SubzeroLLVMDependencies", "src\Reactor\SubzeroLLVMDependencies.vcxproj", "{E3BBD7DA-45C1-43EF-9C87-3F411031BDE4}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittests", "tests\unittests\unittests.vcxproj", "{CF8EBC89-8762-49DC-9440-6C82B3499913}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -768,6 +770,18 @@ Global
{E3BBD7DA-45C1-43EF-9C87-3F411031BDE4}.Release|Win32.Build.0 = Release|Win32
{E3BBD7DA-45C1-43EF-9C87-3F411031BDE4}.Release|x64.ActiveCfg = Release|x64
{E3BBD7DA-45C1-43EF-9C87-3F411031BDE4}.Release|x64.Build.0 = Release|x64
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Debug|Win32.Build.0 = Debug|Win32
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Debug|x64.ActiveCfg = Debug|x64
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Debug|x64.Build.0 = Debug|x64
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Profile|Win32.ActiveCfg = Release|Win32
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Profile|Win32.Build.0 = Release|Win32
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Profile|x64.ActiveCfg = Release|x64
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Profile|x64.Build.0 = Release|x64
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Release|Win32.ActiveCfg = Release|Win32
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Release|Win32.Build.0 = Release|Win32
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Release|x64.ActiveCfg = Release|x64
+ {CF8EBC89-8762-49DC-9440-6C82B3499913}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -810,5 +824,6 @@ Global
{09ABE661-9BC0-4152-A820-1FB0522CAC01} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}
{9088FC9E-9843-4E0D-85D0-1B657AFC480A} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}
{4EC107AB-89E8-4A0B-8366-B3E81085AE07} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
+ {CF8EBC89-8762-49DC-9440-6C82B3499913} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
EndGlobalSection
EndGlobal
diff --git a/chromium/third_party/swiftshader/docs/Index.md b/chromium/third_party/swiftshader/docs/Index.md
index ab9784d952b..9c8a4b38062 100644
--- a/chromium/third_party/swiftshader/docs/Index.md
+++ b/chromium/third_party/swiftshader/docs/Index.md
@@ -20,7 +20,7 @@ The Renderer layer generates specialized processing routines for draw calls and
Reactor is an embedded language for C++ to dynamically generate code in a WYSIWYG fashion. It allows to specialize the processing routines for the state and shaders used by each draw call. Its syntax closely resembles C and shading languages, to make the code generation easily readable.
-The JIT layer is a run-time compiler, such as [LLVM](http://llvm.org/)'s JIT. Reactor records its operations in an in-memory intermediate form which can be materialized by the JIT into a function which can be called directly.
+The JIT layer is a run-time compiler, such as [LLVM](http://llvm.org/)'s JIT, or [Subzero](Subzero.md). Reactor records its operations in an in-memory intermediate form which can be materialized by the JIT into a function which can be called directly.
Design
------
diff --git a/chromium/third_party/swiftshader/docs/Subzero.md b/chromium/third_party/swiftshader/docs/Subzero.md
new file mode 100644
index 00000000000..7bb853b4735
--- /dev/null
+++ b/chromium/third_party/swiftshader/docs/Subzero.md
@@ -0,0 +1,19 @@
+Subzero Documentation
+=====================
+
+Subzero is a JIT compiler used as a back-end for [Reactor](Reactor.md). It originates from Chrome's [Portable Native Client](https://developer.chrome.com/native-client) project. Its authoritative repository is at [https://chromium.googlesource.com/native_client/pnacl-subzero/](https://chromium.googlesource.com/native_client/pnacl-subzero/).
+
+Subzero for SwiftShader
+-----------------------
+
+SwiftShader contains a fork of the Subzero source code (at the time of writing they are in sync). It is an alternative JIT compiler back-end, with LLVM still being the default for CMake builds. To build SwiftShader with Subzero instead of LLVM, specify -DREACTOR_BACKEND=Subzero in your CMake command (or change LLVM to Subzero in the CMake GUI). For Chrome builds that use the BUILD.gn files, Subzero is the default as it produces significantly smaller binaries than with LLVM.
+
+Subzero Development
+-------------------
+
+Development on Subzero itself requires setting up the NaCl environment on a Linux system to be able to run its unit tests:
+
+* Install Chrome's [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools).
+* Run `mkdir nacl && cd nacl && fetch nacl` ([ref](http://www.chromium.org/nativeclient/how-tos/how-to-use-git-svn-with-native-client)).
+* Run `native_client/toolchain_build/toolchain_build_pnacl.py --verbose --sync --clobber --install toolchain/linux_x86/pnacl_newlib_raw` ([ref](https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/developing-pnacl#TOC-TL-DR-for-checking-out-PNaCl-sources-building-and-testing)).
+* Run all unit tests with `make -f Makefile.standalone check` ([ref](https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/docs/README.rst)).
diff --git a/chromium/third_party/swiftshader/extensions/CHROMIUM_texture_filtering_hint.txt b/chromium/third_party/swiftshader/extensions/CHROMIUM_texture_filtering_hint.txt
new file mode 100644
index 00000000000..38af6e01016
--- /dev/null
+++ b/chromium/third_party/swiftshader/extensions/CHROMIUM_texture_filtering_hint.txt
@@ -0,0 +1,85 @@
+Name
+
+ CHROMIUM_texture_filtering_hint
+
+Name Strings
+
+ GL_CHROMIUM_texture_filtering_hint
+
+Contributors
+
+ Alexis Hetu, Google Inc.
+ Nicolas Capens, Google Inc.
+ Shannon Woods, Google Inc.
+
+Contact
+
+ Alexis Hetu, Google Inc. (sugoi 'at' chromium 'dot' org)
+
+Version
+
+ Last Modifed Date: July 18, 2017
+
+Dependencies
+
+ This extension is written against the OpenGL ES 2.0 specification.
+
+ OpenGL ES 2.0 is required.
+
+Overview
+
+ This extension defines a way to request high precision texture filtering
+ using a new value to Hint.
+
+ When this extension is enabled, TEXTURE_FILTERING_HINT_CHROMIUM can be used
+ by the implementation as a means to distinguish between a performance
+ focused implementation, using FASTEST, or a precision focused
+ implementation, using NICEST.
+
+ Like other hints, either option is spec compliant and the behavior of
+ DONT_CARE is implementation specific.
+
+New Tokens
+
+ Accepted by the <pname> parameter of GetIntegerv, GetFloatv and GetBooleanv
+ and by the <target> parameter of Hint:
+
+ TEXTURE_FILTERING_HINT_CHROMIUM 0x8AF0
+
+New Procedures and Functions
+
+ None.
+
+Errors
+
+ None.
+
+New State
+
+ None.
+
+Issues
+
+ 1) When does the hint take effect?
+
+ At the time of the next draw call, and all subsequent draw calls.
+
+ 2) Does the first draw call after the filtering hint is changed use the
+ updated filtering method?
+
+ Yes
+
+ 3) Can I switch it back and forth between every draw call, multiple times
+ during a single frame?
+
+ Yes
+
+ 4) Do program objects which were created before the filtering hint was
+ changed and which contain sampling instructions use the filtering method
+ from when they were created, or the method at the time of draw call?
+
+ At the time of draw call.
+
+Revision History
+
+ 2/7/2014 Documented the extension
diff --git a/chromium/third_party/swiftshader/src/Android.mk b/chromium/third_party/swiftshader/src/Android.mk
index 36708355edb..eac01d9100c 100644
--- a/chromium/third_party/swiftshader/src/Android.mk
+++ b/chromium/third_party/swiftshader/src/Android.mk
@@ -121,6 +121,14 @@ else
COMMON_CFLAGS += -D__STDC_INT64__
endif
+# gralloc1 is introduced from N MR1
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1)
+COMMON_CFLAGS += -DHAVE_GRALLOC1
+COMMON_C_INCLUDES += \
+ system/core/libsync/include \
+ system/core/libsync
+endif
+
# Common Subzero defines
COMMON_CFLAGS += -DALLOW_DUMP=0 -DALLOW_TIMERS=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_MINIMAL_BUILD=0 -DALLOW_WASM=0 -DICE_THREAD_LOCAL_HACK=1
diff --git a/chromium/third_party/swiftshader/src/Common/GrallocAndroid.cpp b/chromium/third_party/swiftshader/src/Common/GrallocAndroid.cpp
index ae5fc09e2cc..4f873687501 100644
--- a/chromium/third_party/swiftshader/src/Common/GrallocAndroid.cpp
+++ b/chromium/third_party/swiftshader/src/Common/GrallocAndroid.cpp
@@ -27,10 +27,21 @@ GrallocModule::GrallocModule()
const hw_module_t *module = nullptr;
hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
- if(!module)
+ m_major_version = (module->module_api_version >> 8) & 0xff;
+ switch(m_major_version)
{
- ALOGE("Failed to load standard gralloc");
+ case 0:
+ m_module = reinterpret_cast<const gralloc_module_t*>(module);
+ break;
+ case 1:
+#ifdef HAVE_GRALLOC1
+ gralloc1_open(module, &m_gralloc1_device);
+ m_gralloc1_lock = (GRALLOC1_PFN_LOCK) m_gralloc1_device->getFunction(m_gralloc1_device, GRALLOC1_FUNCTION_LOCK);
+ m_gralloc1_unlock = (GRALLOC1_PFN_UNLOCK)m_gralloc1_device->getFunction(m_gralloc1_device, GRALLOC1_FUNCTION_UNLOCK);
+ break;
+#endif
+ default:
+ ALOGE("unknown gralloc major version (%d)", m_major_version);
+ break;
}
-
- m_module = reinterpret_cast<const gralloc_module_t*>(module);
}
diff --git a/chromium/third_party/swiftshader/src/Common/GrallocAndroid.hpp b/chromium/third_party/swiftshader/src/Common/GrallocAndroid.hpp
index dbba0d7cee2..32733727077 100644
--- a/chromium/third_party/swiftshader/src/Common/GrallocAndroid.hpp
+++ b/chromium/third_party/swiftshader/src/Common/GrallocAndroid.hpp
@@ -16,6 +16,12 @@
#define GRALLOC_ANDROID
#include <hardware/gralloc.h>
+#include <cutils/log.h>
+
+#ifdef HAVE_GRALLOC1
+#include <hardware/gralloc1.h>
+#include <sync/sync.h>
+#endif
class GrallocModule
{
@@ -23,17 +29,69 @@ public:
static GrallocModule *getInstance();
int lock(buffer_handle_t handle, int usage, int left, int top, int width, int height, void **vaddr)
{
- return m_module->lock(m_module, handle, usage, left, top, width, height, vaddr);
+ switch(m_major_version)
+ {
+ case 0:
+ {
+ return m_module->lock(m_module, handle, usage, left, top, width, height, vaddr);
+ }
+ case 1:
+#ifdef HAVE_GRALLOC1
+ {
+ gralloc1_rect_t outRect{};
+ outRect.left = left;
+ outRect.top = top;
+ outRect.width = width;
+ outRect.height = height;
+ return m_gralloc1_lock(m_gralloc1_device, handle, usage, usage, &outRect, vaddr, -1);
+ }
+#endif
+ default:
+ {
+ ALOGE("no gralloc module to lock");
+ return -1;
+ }
+ }
}
int unlock(buffer_handle_t handle)
{
- return m_module->unlock(m_module, handle);
+ switch(m_major_version)
+ {
+ case 0:
+ {
+ return m_module->unlock(m_module, handle);
+ }
+ case 1:
+#ifdef HAVE_GRALLOC1
+ {
+ int32_t fenceFd = -1;
+ int error = m_gralloc1_unlock(m_gralloc1_device, handle, &fenceFd);
+ if (!error)
+ {
+ sync_wait(fenceFd, -1);
+ close(fenceFd);
+ }
+ return error;
+ }
+#endif
+ default:
+ {
+ ALOGE("no gralloc module to unlock");
+ return -1;
+ }
+ }
}
private:
GrallocModule();
+ uint8_t m_major_version;
const gralloc_module_t *m_module;
+#ifdef HAVE_GRALLOC1
+ gralloc1_device_t *m_gralloc1_device = nullptr;
+ GRALLOC1_PFN_LOCK m_gralloc1_lock = nullptr;
+ GRALLOC1_PFN_UNLOCK m_gralloc1_unlock = nullptr;
+#endif
};
#endif // GRALLOC_ANDROID
diff --git a/chromium/third_party/swiftshader/src/Common/Memory.cpp b/chromium/third_party/swiftshader/src/Common/Memory.cpp
index 2019caec7e0..f946d2fa342 100644
--- a/chromium/third_party/swiftshader/src/Common/Memory.cpp
+++ b/chromium/third_party/swiftshader/src/Common/Memory.cpp
@@ -32,8 +32,6 @@
#undef allocate
#undef deallocate
-#undef allocateZero
-#undef deallocateZero
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined (_M_X64)) && !defined(__x86__)
#define __x86__
@@ -65,10 +63,10 @@ struct Allocation
unsigned char *block;
};
-void *allocate(size_t bytes, size_t alignment)
+inline void *allocateRaw(size_t bytes, size_t alignment)
{
unsigned char *block = new unsigned char[bytes + sizeof(Allocation) + alignment];
- unsigned char *aligned = 0;
+ unsigned char *aligned = nullptr;
if(block)
{
@@ -82,9 +80,9 @@ void *allocate(size_t bytes, size_t alignment)
return aligned;
}
-void *allocateZero(size_t bytes, size_t alignment)
+void *allocate(size_t bytes, size_t alignment)
{
- void *memory = allocate(bytes, alignment);
+ void *memory = allocateRaw(bytes, alignment);
if(memory)
{
diff --git a/chromium/third_party/swiftshader/src/Common/Memory.hpp b/chromium/third_party/swiftshader/src/Common/Memory.hpp
index dd39fae4706..8d3a159d324 100644
--- a/chromium/third_party/swiftshader/src/Common/Memory.hpp
+++ b/chromium/third_party/swiftshader/src/Common/Memory.hpp
@@ -23,7 +23,6 @@ namespace sw
size_t memoryPageSize();
void *allocate(size_t bytes, size_t alignment = 16);
-void *allocateZero(size_t bytes, size_t alignment = 16);
void deallocate(void *memory);
void *allocateExecutable(size_t bytes); // Allocates memory that can be made executable using markExecutable()
diff --git a/chromium/third_party/swiftshader/src/Common/Resource.cpp b/chromium/third_party/swiftshader/src/Common/Resource.cpp
index b016c95a4e9..e16968a88b2 100644
--- a/chromium/third_party/swiftshader/src/Common/Resource.cpp
+++ b/chromium/third_party/swiftshader/src/Common/Resource.cpp
@@ -26,7 +26,7 @@ namespace sw
count = 0;
orphaned = false;
- buffer = allocateZero(bytes);
+ buffer = allocate(bytes);
}
Resource::~Resource()
diff --git a/chromium/third_party/swiftshader/src/Common/SharedLibrary.hpp b/chromium/third_party/swiftshader/src/Common/SharedLibrary.hpp
index 8d881c106ec..ab710eb19fc 100644
--- a/chromium/third_party/swiftshader/src/Common/SharedLibrary.hpp
+++ b/chromium/third_party/swiftshader/src/Common/SharedLibrary.hpp
@@ -59,7 +59,7 @@ void *loadLibrary(const char *(&names)[n], const char *mustContainSymbol = nullp
}
}
- return 0;
+ return nullptr;
}
#if defined(_WIN32)
@@ -70,7 +70,7 @@ void *loadLibrary(const char *(&names)[n], const char *mustContainSymbol = nullp
inline void *getLibraryHandle(const char *path)
{
- HMODULE module = 0;
+ HMODULE module = NULL;
GetModuleHandleEx(0, path, &module);
return (void*)module;
}
@@ -103,7 +103,7 @@ void *loadLibrary(const char *(&names)[n], const char *mustContainSymbol = nullp
return dlopen(path, RTLD_LAZY | RTLD_LOCAL); // Increment reference count
}
- return 0;
+ return nullptr;
#endif
}
diff --git a/chromium/third_party/swiftshader/src/Common/Thread.hpp b/chromium/third_party/swiftshader/src/Common/Thread.hpp
index 8f6443e03c1..3b9e67443d3 100644
--- a/chromium/third_party/swiftshader/src/Common/Thread.hpp
+++ b/chromium/third_party/swiftshader/src/Common/Thread.hpp
@@ -25,7 +25,7 @@
#include <pthread.h>
#include <sched.h>
#include <unistd.h>
- #define TLS_OUT_OF_INDEXES (~0)
+ #define TLS_OUT_OF_INDEXES (pthread_key_t)(~0)
#endif
namespace sw
@@ -135,7 +135,7 @@ namespace sw
return TlsAlloc();
#else
LocalStorageKey key;
- pthread_key_create(&key, 0);
+ pthread_key_create(&key, NULL);
return key;
#endif
}
@@ -145,7 +145,7 @@ namespace sw
#if defined(_WIN32)
TlsFree(key);
#else
- pthread_key_delete(key);
+ pthread_key_delete(key); // Using an invalid key is an error but not undefined behavior.
#endif
}
@@ -154,7 +154,10 @@ namespace sw
#if defined(_WIN32)
TlsSetValue(key, value);
#else
- pthread_setspecific(key, value);
+ if(key != TLS_OUT_OF_INDEXES) // Avoid undefined behavior.
+ {
+ pthread_setspecific(key, value);
+ }
#endif
}
@@ -163,6 +166,11 @@ namespace sw
#if defined(_WIN32)
return TlsGetValue(key);
#else
+ if(key == TLS_OUT_OF_INDEXES) // Avoid undefined behavior.
+ {
+ return nullptr;
+ }
+
return pthread_getspecific(key);
#endif
}
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3D8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3D8.hpp
index 10178463bea..bc514a3b89a 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3D8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3D8.hpp
@@ -30,27 +30,27 @@ namespace D3D8
public:
Direct3D8(int version, const HINSTANCE instance);
- virtual ~Direct3D8();
+ ~Direct3D8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3D8 methods
- long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat);
- long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapaterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat);
- long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType);
- long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed);
- long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice8 **returnedDeviceInterface);
- long __stdcall EnumAdapterModes(unsigned int adapter, unsigned int index, D3DDISPLAYMODE *mode);
- unsigned int __stdcall GetAdapterCount();
- long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode);
- long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER8 *identifier);
- unsigned int __stdcall GetAdapterModeCount(unsigned int adapter);
- HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter);
- long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS8 *caps);
- long __stdcall RegisterSoftwareDevice(void *initializeFunction);
+ long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
+ long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapaterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
+ long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType) override;
+ long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
+ long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice8 **returnedDeviceInterface) override;
+ long __stdcall EnumAdapterModes(unsigned int adapter, unsigned int index, D3DDISPLAYMODE *mode) override;
+ unsigned int __stdcall GetAdapterCount() override;
+ long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
+ long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER8 *identifier) override;
+ unsigned int __stdcall GetAdapterModeCount(unsigned int adapter) override;
+ HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
+ long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS8 *caps) override;
+ long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
private:
void loadSystemD3D8();
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.cpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.cpp
index 3a3f208cabd..fe1aa765a76 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.cpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.cpp
@@ -135,7 +135,7 @@ namespace D3D8
return LOD;
}
- long Direct3DBaseTexture8::SetLOD(long newLOD)
+ unsigned long Direct3DBaseTexture8::SetLOD(unsigned long newLOD)
{
TRACE("");
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.hpp
index ab69abac583..4a780b53461 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DBaseTexture8.hpp
@@ -31,27 +31,27 @@ namespace D3D8
public:
Direct3DBaseTexture8(Direct3DDevice8 *device, D3DRESOURCETYPE type, unsigned long levels, unsigned long usage);
- virtual ~Direct3DBaseTexture8();
+ ~Direct3DBaseTexture8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture8 methods
- unsigned long __stdcall GetLevelCount();
- unsigned long __stdcall GetLOD();
- long __stdcall SetLOD(long newLOD);
+ unsigned long __stdcall GetLevelCount() override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// Intenal methods
sw::Resource *getResource() const;
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DCubeTexture8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DCubeTexture8.hpp
index 91071524ee2..233afaf71b2 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DCubeTexture8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DCubeTexture8.hpp
@@ -30,34 +30,34 @@ namespace D3D8
public:
Direct3DCubeTexture8(Direct3DDevice8 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DCubeTexture8();
+ ~Direct3DCubeTexture8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture methods
- unsigned long __stdcall GetLevelCount();
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall SetLOD(unsigned long newLOD);
+ unsigned long __stdcall GetLevelCount() override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// IDirect3DCubeTexture8 methods
- long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect);
- long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level , IDirect3DSurface8 **cubeMapSurface);
- long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description);
- long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags);
- long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level);
+ long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect) override;
+ long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level , IDirect3DSurface8 **cubeMapSurface) override;
+ long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
+ long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
+ long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level) override;
// Internal methods
Direct3DSurface8 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level);
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.cpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.cpp
index ff85a7ae52f..6294fbb1a40 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.cpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.cpp
@@ -81,7 +81,7 @@ namespace D3D8
pixelShaderHandle = 0;
lightsDirty = true;
-
+
for(int i = 0; i < 16; i++)
{
dataStream[i] = 0;
@@ -176,13 +176,13 @@ namespace D3D8
swapChain[i] = 0;
}
}
-
+
if(depthStencil)
{
depthStencil->unbind();
depthStencil = 0;
}
-
+
if(renderTarget)
{
renderTarget->unbind();
@@ -270,7 +270,7 @@ namespace D3D8
return Unknown::AddRef();
}
-
+
unsigned long Direct3DDevice8::Release()
{
TRACE("");
@@ -311,7 +311,7 @@ namespace D3D8
TRACE("");
stateRecorder[token]->Capture();
-
+
return D3D_OK;
}
@@ -488,7 +488,7 @@ namespace D3D8
sourceSurface->UnlockRect();
destinationSurface->UnlockRect();
}
-
+
return D3D_OK;
}
@@ -678,7 +678,7 @@ namespace D3D8
pixelShader[index]->AddRef();
*handle = index;
-
+
return D3D_OK;
}
@@ -708,7 +708,7 @@ namespace D3D8
}
(*surface)->AddRef();
-
+
return D3D_OK;
}
@@ -778,7 +778,7 @@ namespace D3D8
}
(*vertexBuffer)->AddRef();
-
+
return D3D_OK;
}
@@ -865,7 +865,7 @@ namespace D3D8
stateRecorder[token]->unbind();
stateRecorder[token] = 0;
-
+
return D3D_OK;
}
@@ -936,7 +936,7 @@ namespace D3D8
bindData(indexData, baseVertexIndex);
renderer->draw(drawType, indexOffset, primitiveCount);
-
+
return D3D_OK;
}
@@ -965,7 +965,7 @@ namespace D3D8
}
int length = (minIndex + numVertices) * vertexStreamZeroStride;
-
+
Direct3DVertexBuffer8 *vertexBuffer = new Direct3DVertexBuffer8(this, length, 0, 0, D3DPOOL_DEFAULT);
unsigned char *data;
@@ -1098,7 +1098,7 @@ namespace D3D8
length *= vertexStreamZeroStride;
CreateVertexBuffer(length, 0, 0, D3DPOOL_DEFAULT, &vertexBuffer);
-
+
unsigned char *data;
vertexBuffer->Lock(0, 0, &data, 0);
memcpy(data, vertexStreamZeroData, length);
@@ -1131,7 +1131,7 @@ namespace D3D8
SetStreamSource(0, 0, 0);
vertexBuffer->Release();
-
+
return D3D_OK;
}
@@ -1344,7 +1344,7 @@ namespace D3D8
swapChain[0]->screenshot(description.pBits);
destSurface->UnlockRect();
-
+
return D3D_OK;
}
@@ -1401,7 +1401,7 @@ namespace D3D8
case 6: UNIMPLEMENTED(); // FIXME: D3DDEVINFOID_D3DVERTEXSTATS
case 7: return E_FAIL;
}
-
+
return D3D_OK;
}
@@ -1561,7 +1561,7 @@ namespace D3D8
*renderTarget = this->renderTarget;
this->renderTarget->AddRef();
-
+
return D3D_OK;
}
@@ -1575,7 +1575,7 @@ namespace D3D8
}
*streamData = dataStream[streamNumber];
-
+
if(dataStream[streamNumber])
{
dataStream[streamNumber]->AddRef();
@@ -1596,7 +1596,7 @@ namespace D3D8
}
*texture = this->texture[stage];
-
+
if(this->texture[stage])
{
this->texture[stage]->AddRef();
@@ -1739,7 +1739,7 @@ namespace D3D8
light.Direction.y = 0;
light.Direction.z = 1;
light.Range = 0;
- light.Falloff = 0;
+ light.Falloff = 0;
light.Attenuation0 = 0;
light.Attenuation1 = 0;
light.Attenuation2 = 0;
@@ -1879,13 +1879,13 @@ namespace D3D8
swapChain[0]->unbind();
swapChain[0] = 0;
}
-
+
if(depthStencil)
{
depthStencil->unbind();
depthStencil = 0;
}
-
+
if(renderTarget)
{
renderTarget->unbind();
@@ -2047,7 +2047,7 @@ namespace D3D8
delete cursor;
showCursor = false;
- return D3D_OK;
+ return D3D_OK;
}
long Direct3DDevice8::ResourceManagerDiscardBytes(unsigned long bytes)
@@ -2133,11 +2133,6 @@ namespace D3D8
sw::FrameBuffer::setCursorPosition(point.x, point.y);
}
- void Direct3DDevice8::SetCursorPosition(unsigned int x, unsigned int y, unsigned long flags)
- {
- SetCursorPosition((int)x, (int)y, flags);
- }
-
long Direct3DDevice8::SetCursorProperties(unsigned int x0, unsigned int y0, IDirect3DSurface8 *cursorBitmap)
{
TRACE("");
@@ -2154,7 +2149,7 @@ namespace D3D8
cursorBitmap->LockRect(&lock, 0, 0);
delete cursor;
- cursor = new sw::Surface(0, desc.Width, desc.Height, 1, sw::FORMAT_A8R8G8B8, false, false);
+ cursor = sw::Surface::create(0, desc.Width, desc.Height, 1, sw::FORMAT_A8R8G8B8, false, false);
void *buffer = cursor->lockExternal(0, 0, 0, sw::LOCK_DISCARD, sw::PUBLIC);
memcpy(buffer, lock.pBits, desc.Width * desc.Height * sizeof(unsigned int));
@@ -2179,7 +2174,7 @@ namespace D3D8
}
swapChain[0]->setGammaRamp((sw::GammaRamp*)ramp, flags & D3DSGR_CALIBRATE);
-
+
return;
}
@@ -2333,7 +2328,7 @@ namespace D3D8
renderState[state] = value;
switch(state)
- {
+ {
case D3DRS_ZENABLE:
switch(value)
{
@@ -2488,7 +2483,7 @@ namespace D3D8
ASSERT(false);
}
break;
- case D3DRS_CULLMODE:
+ case D3DRS_CULLMODE:
switch(value)
{
case D3DCULL_NONE:
@@ -3098,10 +3093,10 @@ namespace D3D8
{
stateRecorder.back()->setStreamSource(stream, vertexBuffer, stride);
}
-
+
return D3D_OK;
}
-
+
long Direct3DDevice8::SetTexture(unsigned long stage, IDirect3DBaseTexture8 *iBaseTexture)
{
TRACE("");
@@ -3301,7 +3296,7 @@ namespace D3D8
renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TEXTURE);
break;
case D3DTA_TFACTOR:
- renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TFACTOR);
+ renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TFACTOR);
break;
case D3DTA_SPECULAR:
renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_SPECULAR);
@@ -3928,14 +3923,14 @@ namespace D3D8
Direct3DVertexShader8 *shader = vertexShader[index];
renderer->setVertexShader(shader->getVertexShader());
declaration = shader->getDeclaration();
-
+
FVF = 0;
}
else
{
renderer->setVertexShader(0);
declaration = 0;
-
+
FVF = handle;
}
}
@@ -3993,7 +3988,7 @@ namespace D3D8
{
stateRecorder.back()->setViewport(viewport);
}
-
+
return D3D_OK;
}
@@ -4160,7 +4155,7 @@ namespace D3D8
RECT sRect;
RECT dRect;
-
+
if(sourceRect && destPoint)
{
sRect.left = sourceRect->left;
@@ -4237,14 +4232,14 @@ namespace D3D8
for(unsigned int y = 0; y < height; y++)
{
memcpy(destinationLock.pBits, sourceLock.pBits, bytes);
-
+
(byte*&)sourceLock.pBits += sourceLock.Pitch;
(byte*&)destinationLock.pBits += destinationLock.Pitch;
}
sourceSurface->UnlockRect();
destinationSurface->UnlockRect();
-
+
return D3D_OK;
}
@@ -4296,7 +4291,7 @@ namespace D3D8
if(FVF & D3DFVF_PSIZE) stride += 4;
if(FVF & D3DFVF_DIFFUSE) stride += 4;
if(FVF & D3DFVF_SPECULAR) stride += 4;
-
+
switch((FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT)
{
case 8: stride += 4 + 4 * ((1 + (FVF >> 30)) % 4);
@@ -4428,25 +4423,25 @@ namespace D3D8
{
renderer->setInputStream(sw::BlendIndices, attribute.define((char*&)buffer - 4, sw::STREAMTYPE_INDICES, 1));
}
-
+
if(FVF & D3DFVF_NORMAL)
{
renderer->setInputStream(sw::Normal, attribute.define(buffer, sw::STREAMTYPE_FLOAT, 3));
(char*&)buffer += 12;
}
-
+
if(FVF & D3DFVF_PSIZE)
{
renderer->setInputStream(sw::PointSize, attribute.define(buffer, sw::STREAMTYPE_FLOAT, 1));
(char*&)buffer += 4;
}
-
+
if(FVF & D3DFVF_DIFFUSE)
{
renderer->setInputStream(sw::Color0, attribute.define(buffer, sw::STREAMTYPE_COLOR, 4));
(char*&)buffer += 4;
}
-
+
if(FVF & D3DFVF_SPECULAR)
{
renderer->setInputStream(sw::Color1, attribute.define(buffer, sw::STREAMTYPE_COLOR, 4));
@@ -4633,7 +4628,7 @@ namespace D3D8
renderer->setLightDiffuse(active, diffuse);
renderer->setLightSpecular(active, specular);
renderer->setLightAmbient(active, ambient);
-
+
if(l.Type == D3DLIGHT_DIRECTIONAL)
{
// goto next; // FIXME
@@ -4734,7 +4729,7 @@ namespace D3D8
if(baseTexture && textureUsed)
{
int levelCount = baseTexture->getInternalLevelCount();
-
+
int textureLOD = baseTexture->GetLOD();
int stageLOD = textureStageState[stage][D3DTSS_MAXMIPLEVEL];
int LOD = textureLOD > stageLOD ? textureLOD : stageLOD;
@@ -4849,7 +4844,7 @@ namespace D3D8
sw::FrameBuffer::setCursorImage(cursor);
HCURSOR oldCursor = SetCursor(nullCursor);
-
+
if(oldCursor != nullCursor)
{
win32Cursor = oldCursor;
@@ -4906,7 +4901,7 @@ namespace D3D8
sourceVolume->UnlockBox();
destinationVolume->UnlockBox();
-
+
return D3D_OK;
}
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.hpp
index 203849d984a..179a2d80b90 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DDevice8.hpp
@@ -48,109 +48,108 @@ namespace D3D8
public:
Direct3DDevice8(const HINSTANCE instance, Direct3D8 *d3d8, unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviourFlags, D3DPRESENT_PARAMETERS *presentParameters);
- virtual ~Direct3DDevice8();
+ ~Direct3DDevice8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DDevice8 methods
- long __stdcall ApplyStateBlock(unsigned long token);
- long __stdcall BeginScene();
- long __stdcall BeginStateBlock();
- long __stdcall CaptureStateBlock(unsigned long token);
- long __stdcall Clear(unsigned long count, const D3DRECT *rects, unsigned long flags, unsigned long color, float z, unsigned long stencil);
- long __stdcall CopyRects(IDirect3DSurface8 *sourceSurface, const RECT *sourceRectsArray, unsigned int rects, IDirect3DSurface8 *destinationSurface, const POINT *destPointsArray);
- long __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *presentParameters, IDirect3DSwapChain8 **swapChain);
- long __stdcall CreateCubeTexture(unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture8 **cubeTexture);
- long __stdcall CreateDepthStencilSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, IDirect3DSurface8 **surface);
- long __stdcall CreateImageSurface(unsigned int width, unsigned int height, D3DFORMAT format, IDirect3DSurface8 **surface);
- long __stdcall CreateIndexBuffer(unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer8 **indexBuffer);
- long __stdcall CreatePixelShader(const unsigned long *function, unsigned long *handle);
- long __stdcall CreateRenderTarget(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, int lockable, IDirect3DSurface8 **surface);
- long __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE type, unsigned long *token);
- long __stdcall CreateTexture(unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture8 **texture);
- long __stdcall CreateVertexBuffer(unsigned int length, unsigned long usage, unsigned long FVF, D3DPOOL, IDirect3DVertexBuffer8 **vertexBuffer);
- long __stdcall CreateVertexShader(const unsigned long *declaration, const unsigned long *function, unsigned long *handle, unsigned long usage);
- long __stdcall CreateVolumeTexture(unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture8 **volumeTexture);
- long __stdcall DeletePatch(unsigned int handle);
- long __stdcall DeletePixelShader(unsigned long handle);
- long __stdcall DeleteStateBlock(unsigned long token);
- long __stdcall DeleteVertexShader(unsigned long handle);
- long __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE type, unsigned int minIndex, unsigned int numVertices, unsigned int startIndex, unsigned int primitiveCount);
- long __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE type, unsigned int minVertexIndex, unsigned int numVertexIndices, unsigned int PrimitiveCount, const void *indexData, D3DFORMAT indexDataFormat, const void *vertexStreamZeroData, unsigned int VertexStreamZeroStride);
- long __stdcall DrawPrimitive(D3DPRIMITIVETYPE primitiveType, unsigned int startVertex, unsigned int primiveCount);
- long __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE primitiveType, unsigned int primitiveCount, const void *vertexStreamZeroData, unsigned int vertexStreamZeroStride);
- long __stdcall DrawRectPatch(unsigned int handle, const float *numSegs, const D3DRECTPATCH_INFO *rectPatchInfo);
- long __stdcall DrawTriPatch(unsigned int handle, const float *numSegs, const D3DTRIPATCH_INFO *triPatchInfo);
- long __stdcall EndScene();
- long __stdcall EndStateBlock(unsigned long *token);
- unsigned int __stdcall GetAvailableTextureMem();
- long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface8 **backBuffer);
- long __stdcall GetClipPlane(unsigned long index, float *plane);
- long __stdcall GetClipStatus(D3DCLIPSTATUS8 *clipStatus);
- long __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *parameters);
- long __stdcall GetCurrentTexturePalette(unsigned int *paletteNumber);
- long __stdcall GetDepthStencilSurface(IDirect3DSurface8 **depthStencilSurface);
- long __stdcall GetDeviceCaps(D3DCAPS8 *caps);
- long __stdcall GetDirect3D(IDirect3D8 **D3D);
- long __stdcall GetDisplayMode(D3DDISPLAYMODE *mode);
- long __stdcall GetFrontBuffer(IDirect3DSurface8 *destSurface);
- void __stdcall GetGammaRamp(D3DGAMMARAMP *ramp);
- long __stdcall GetIndices(IDirect3DIndexBuffer8 **indexData, unsigned int *baseVertexIndex);
- long __stdcall GetInfo(unsigned long devInfoID, void *devInfoStruct, unsigned long devInfoStructSize);
- long __stdcall GetLight(unsigned long index, D3DLIGHT8 *p);
- long __stdcall GetLightEnable(unsigned long index , int *enable);
- long __stdcall GetMaterial(D3DMATERIAL8 *material);
- long __stdcall GetPaletteEntries(unsigned int paletteNumber, PALETTEENTRY *entries);
- long __stdcall GetPixelShader(unsigned long *handle);
- long __stdcall GetPixelShaderFunction(unsigned long handle, void *data, unsigned long *sizeOfData);
- long __stdcall GetPixelShaderConstant(unsigned long startRegister, void *constantData, unsigned long constantCount);
- long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus);
- long __stdcall GetRenderState(D3DRENDERSTATETYPE State, unsigned long *value);
- long __stdcall GetRenderTarget(IDirect3DSurface8 **renderTarget);
- long __stdcall GetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer8 **streamData, unsigned int *stride);
- long __stdcall GetTexture(unsigned long stage, IDirect3DBaseTexture8 **texture);
- long __stdcall GetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long *value);
- long __stdcall GetTransform(D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix);
- long __stdcall GetVertexShader(unsigned long *handle);
- long __stdcall GetVertexShaderConstant(unsigned long startRegister, void *constantData, unsigned long constantCount);
- long __stdcall GetVertexShaderDeclaration(unsigned long handle, void *data, unsigned long *size);
- long __stdcall GetVertexShaderFunction(unsigned long handle, void *data, unsigned long *size);
- long __stdcall GetViewport(D3DVIEWPORT8 *viewport);
- long __stdcall LightEnable(unsigned long index, int enable);
- long __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix);
- long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion);
- long __stdcall ProcessVertices(unsigned int srcStartIndex, unsigned int destIndex, unsigned int vertexCount, IDirect3DVertexBuffer8 *destBuffer, unsigned long flags);
- long __stdcall Reset(D3DPRESENT_PARAMETERS *presentParameters);
- long __stdcall ResourceManagerDiscardBytes(unsigned long bytes);
- long __stdcall SetClipPlane(unsigned long index, const float *plane);
- long __stdcall SetClipStatus(const D3DCLIPSTATUS8 *clipStatus);
- long __stdcall SetCurrentTexturePalette(unsigned int paletteNumber);
- void __stdcall SetCursorPosition(int x, int y, unsigned long flags);
- void __stdcall SetCursorPosition(unsigned int x, unsigned int y, unsigned long flags);
- long __stdcall SetCursorProperties(unsigned int x, unsigned int y, IDirect3DSurface8 *cursorBitmap);
- void __stdcall SetGammaRamp(unsigned long flags, const D3DGAMMARAMP *ramp);
- long __stdcall SetIndices(IDirect3DIndexBuffer8 *indexData, unsigned int baseVertexIndex);
- long __stdcall SetLight(unsigned long index, const D3DLIGHT8 *light);
- long __stdcall SetMaterial(const D3DMATERIAL8 *material);
- long __stdcall SetPaletteEntries(unsigned int paletteNumber, const PALETTEENTRY *entries);
- long __stdcall SetPixelShader(unsigned long shader);
- long __stdcall SetPixelShaderConstant(unsigned long startRegister, const void *constantData, unsigned long constantCount);
- long __stdcall SetRenderState(D3DRENDERSTATETYPE state, unsigned long value);
- long __stdcall SetRenderTarget(IDirect3DSurface8 *renderTarget, IDirect3DSurface8 *newZStencil);
- long __stdcall SetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer8 *streamData, unsigned int stride);
- long __stdcall SetTexture(unsigned long stage, IDirect3DBaseTexture8 *texture);
- long __stdcall SetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long value);
- long __stdcall SetTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix);
- long __stdcall SetVertexShader(unsigned long handle);
- long __stdcall SetVertexShaderConstant(unsigned long startRegister, const void *constantData, unsigned long constantCount);
- long __stdcall SetViewport(const D3DVIEWPORT8 *viewport);
- int __stdcall ShowCursor(int show);
- long __stdcall TestCooperativeLevel();
- long __stdcall UpdateTexture(IDirect3DBaseTexture8 *sourceTexture, IDirect3DBaseTexture8 *destinationTexture);
- long __stdcall ValidateDevice(unsigned long *numPasses);
+ long __stdcall ApplyStateBlock(unsigned long token) override;
+ long __stdcall BeginScene() override;
+ long __stdcall BeginStateBlock() override;
+ long __stdcall CaptureStateBlock(unsigned long token) override;
+ long __stdcall Clear(unsigned long count, const D3DRECT *rects, unsigned long flags, unsigned long color, float z, unsigned long stencil) override;
+ long __stdcall CopyRects(IDirect3DSurface8 *sourceSurface, const RECT *sourceRectsArray, unsigned int rects, IDirect3DSurface8 *destinationSurface, const POINT *destPointsArray) override;
+ long __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *presentParameters, IDirect3DSwapChain8 **swapChain) override;
+ long __stdcall CreateCubeTexture(unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture8 **cubeTexture) override;
+ long __stdcall CreateDepthStencilSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, IDirect3DSurface8 **surface) override;
+ long __stdcall CreateImageSurface(unsigned int width, unsigned int height, D3DFORMAT format, IDirect3DSurface8 **surface) override;
+ long __stdcall CreateIndexBuffer(unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer8 **indexBuffer) override;
+ long __stdcall CreatePixelShader(const unsigned long *function, unsigned long *handle) override;
+ long __stdcall CreateRenderTarget(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, int lockable, IDirect3DSurface8 **surface) override;
+ long __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE type, unsigned long *token) override;
+ long __stdcall CreateTexture(unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture8 **texture) override;
+ long __stdcall CreateVertexBuffer(unsigned int length, unsigned long usage, unsigned long FVF, D3DPOOL, IDirect3DVertexBuffer8 **vertexBuffer) override;
+ long __stdcall CreateVertexShader(const unsigned long *declaration, const unsigned long *function, unsigned long *handle, unsigned long usage) override;
+ long __stdcall CreateVolumeTexture(unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture8 **volumeTexture) override;
+ long __stdcall DeletePatch(unsigned int handle) override;
+ long __stdcall DeletePixelShader(unsigned long handle) override;
+ long __stdcall DeleteStateBlock(unsigned long token) override;
+ long __stdcall DeleteVertexShader(unsigned long handle) override;
+ long __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE type, unsigned int minIndex, unsigned int numVertices, unsigned int startIndex, unsigned int primitiveCount) override;
+ long __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE type, unsigned int minVertexIndex, unsigned int numVertexIndices, unsigned int PrimitiveCount, const void *indexData, D3DFORMAT indexDataFormat, const void *vertexStreamZeroData, unsigned int VertexStreamZeroStride) override;
+ long __stdcall DrawPrimitive(D3DPRIMITIVETYPE primitiveType, unsigned int startVertex, unsigned int primiveCount) override;
+ long __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE primitiveType, unsigned int primitiveCount, const void *vertexStreamZeroData, unsigned int vertexStreamZeroStride) override;
+ long __stdcall DrawRectPatch(unsigned int handle, const float *numSegs, const D3DRECTPATCH_INFO *rectPatchInfo) override;
+ long __stdcall DrawTriPatch(unsigned int handle, const float *numSegs, const D3DTRIPATCH_INFO *triPatchInfo) override;
+ long __stdcall EndScene() override;
+ long __stdcall EndStateBlock(unsigned long *token) override;
+ unsigned int __stdcall GetAvailableTextureMem() override;
+ long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface8 **backBuffer) override;
+ long __stdcall GetClipPlane(unsigned long index, float *plane) override;
+ long __stdcall GetClipStatus(D3DCLIPSTATUS8 *clipStatus) override;
+ long __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *parameters) override;
+ long __stdcall GetCurrentTexturePalette(unsigned int *paletteNumber) override;
+ long __stdcall GetDepthStencilSurface(IDirect3DSurface8 **depthStencilSurface) override;
+ long __stdcall GetDeviceCaps(D3DCAPS8 *caps) override;
+ long __stdcall GetDirect3D(IDirect3D8 **D3D) override;
+ long __stdcall GetDisplayMode(D3DDISPLAYMODE *mode) override;
+ long __stdcall GetFrontBuffer(IDirect3DSurface8 *destSurface) override;
+ void __stdcall GetGammaRamp(D3DGAMMARAMP *ramp) override;
+ long __stdcall GetIndices(IDirect3DIndexBuffer8 **indexData, unsigned int *baseVertexIndex) override;
+ long __stdcall GetInfo(unsigned long devInfoID, void *devInfoStruct, unsigned long devInfoStructSize) override;
+ long __stdcall GetLight(unsigned long index, D3DLIGHT8 *p) override;
+ long __stdcall GetLightEnable(unsigned long index , int *enable) override;
+ long __stdcall GetMaterial(D3DMATERIAL8 *material) override;
+ long __stdcall GetPaletteEntries(unsigned int paletteNumber, PALETTEENTRY *entries) override;
+ long __stdcall GetPixelShader(unsigned long *handle) override;
+ long __stdcall GetPixelShaderFunction(unsigned long handle, void *data, unsigned long *sizeOfData) override;
+ long __stdcall GetPixelShaderConstant(unsigned long startRegister, void *constantData, unsigned long constantCount) override;
+ long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus) override;
+ long __stdcall GetRenderState(D3DRENDERSTATETYPE State, unsigned long *value) override;
+ long __stdcall GetRenderTarget(IDirect3DSurface8 **renderTarget) override;
+ long __stdcall GetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer8 **streamData, unsigned int *stride) override;
+ long __stdcall GetTexture(unsigned long stage, IDirect3DBaseTexture8 **texture) override;
+ long __stdcall GetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long *value) override;
+ long __stdcall GetTransform(D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix) override;
+ long __stdcall GetVertexShader(unsigned long *handle) override;
+ long __stdcall GetVertexShaderConstant(unsigned long startRegister, void *constantData, unsigned long constantCount) override;
+ long __stdcall GetVertexShaderDeclaration(unsigned long handle, void *data, unsigned long *size) override;
+ long __stdcall GetVertexShaderFunction(unsigned long handle, void *data, unsigned long *size) override;
+ long __stdcall GetViewport(D3DVIEWPORT8 *viewport) override;
+ long __stdcall LightEnable(unsigned long index, int enable) override;
+ long __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) override;
+ long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion) override;
+ long __stdcall ProcessVertices(unsigned int srcStartIndex, unsigned int destIndex, unsigned int vertexCount, IDirect3DVertexBuffer8 *destBuffer, unsigned long flags) override;
+ long __stdcall Reset(D3DPRESENT_PARAMETERS *presentParameters) override;
+ long __stdcall ResourceManagerDiscardBytes(unsigned long bytes) override;
+ long __stdcall SetClipPlane(unsigned long index, const float *plane) override;
+ long __stdcall SetClipStatus(const D3DCLIPSTATUS8 *clipStatus) override;
+ long __stdcall SetCurrentTexturePalette(unsigned int paletteNumber) override;
+ void __stdcall SetCursorPosition(int x, int y, unsigned long flags) override;
+ long __stdcall SetCursorProperties(unsigned int x, unsigned int y, IDirect3DSurface8 *cursorBitmap) override;
+ void __stdcall SetGammaRamp(unsigned long flags, const D3DGAMMARAMP *ramp) override;
+ long __stdcall SetIndices(IDirect3DIndexBuffer8 *indexData, unsigned int baseVertexIndex) override;
+ long __stdcall SetLight(unsigned long index, const D3DLIGHT8 *light) override;
+ long __stdcall SetMaterial(const D3DMATERIAL8 *material) override;
+ long __stdcall SetPaletteEntries(unsigned int paletteNumber, const PALETTEENTRY *entries) override;
+ long __stdcall SetPixelShader(unsigned long shader) override;
+ long __stdcall SetPixelShaderConstant(unsigned long startRegister, const void *constantData, unsigned long constantCount) override;
+ long __stdcall SetRenderState(D3DRENDERSTATETYPE state, unsigned long value) override;
+ long __stdcall SetRenderTarget(IDirect3DSurface8 *renderTarget, IDirect3DSurface8 *newZStencil) override;
+ long __stdcall SetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer8 *streamData, unsigned int stride) override;
+ long __stdcall SetTexture(unsigned long stage, IDirect3DBaseTexture8 *texture) override;
+ long __stdcall SetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long value) override;
+ long __stdcall SetTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) override;
+ long __stdcall SetVertexShader(unsigned long handle) override;
+ long __stdcall SetVertexShaderConstant(unsigned long startRegister, const void *constantData, unsigned long constantCount) override;
+ long __stdcall SetViewport(const D3DVIEWPORT8 *viewport) override;
+ int __stdcall ShowCursor(int show) override;
+ long __stdcall TestCooperativeLevel() override;
+ long __stdcall UpdateTexture(IDirect3DBaseTexture8 *sourceTexture, IDirect3DBaseTexture8 *destinationTexture) override;
+ long __stdcall ValidateDevice(unsigned long *numPasses) override;
// Internal methods
long __stdcall updateSurface(IDirect3DSurface8 *sourceSurface, const RECT *sourceRect, IDirect3DSurface8 *destinationSurface, const POINT *destPoint);
@@ -178,7 +177,7 @@ namespace D3D8
const HWND focusWindow;
const unsigned long behaviourFlags;
const D3DPRESENT_PARAMETERS presentParameters;
-
+
HWND windowHandle;
D3DVIEWPORT8 viewport;
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DIndexBuffer8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DIndexBuffer8.hpp
index 8b241ab6dba..cf141d70a31 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DIndexBuffer8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DIndexBuffer8.hpp
@@ -31,28 +31,28 @@ namespace D3D8
public:
Direct3DIndexBuffer8(Direct3DDevice8 *device, unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DIndexBuffer8();
+ ~Direct3DIndexBuffer8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DIndexBuffer8 methods
- long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description);
- long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags);
- long __stdcall Unlock();
-
+ long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description) override;
+ long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags) override;
+ long __stdcall Unlock() override;
+
// Internal methods
sw::Resource *getResource() const;
bool is32Bit() const;
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DPixelShader8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DPixelShader8.hpp
index daf6a24f545..d9f9725a9e0 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DPixelShader8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DPixelShader8.hpp
@@ -28,14 +28,13 @@ namespace D3D8
public:
Direct3DPixelShader8(Direct3DDevice8 *device, const unsigned long *shaderToken);
- virtual ~Direct3DPixelShader8();
+ ~Direct3DPixelShader8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
- // IDirect3DPixelShader8 methods
void __stdcall GetFunction(void *data, unsigned int *size);
// Internal methods
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DResource8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DResource8.hpp
index b80296a22f5..77eccc690c5 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DResource8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DResource8.hpp
@@ -30,22 +30,22 @@ namespace D3D8
public:
Direct3DResource8(Direct3DDevice8 *device, D3DRESOURCETYPE type, unsigned int size);
- virtual ~Direct3DResource8();
+ ~Direct3DResource8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- void __stdcall PreLoad();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ void __stdcall PreLoad() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// Internal methods
static unsigned int getMemoryUsage();
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DStateBlock8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DStateBlock8.hpp
index 744de2e8683..6d602aafacc 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DStateBlock8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DStateBlock8.hpp
@@ -33,14 +33,13 @@ namespace D3D8
public:
Direct3DStateBlock8(Direct3DDevice8 *device, D3DSTATEBLOCKTYPE type);
- virtual ~Direct3DStateBlock8();
+ ~Direct3DStateBlock8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
- // IDirect3DStateBlock8 methods
long __stdcall Apply();
long __stdcall Capture();
long __stdcall GetDevice(IDirect3DDevice8 **device);
@@ -75,13 +74,13 @@ namespace D3D8
void capturePixelRenderStates();
void capturePixelTextureStates();
void capturePixelShaderStates();
-
+
// Vertex states
void captureVertexRenderStates();
void captureVertexTextureStates();
void captureLightStates();
void captureVertexShaderStates();
-
+
// All (remaining) states
void captureTextures();
void captureVertexTextures();
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.cpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.cpp
index 2a4dea6811c..6ad0e6b8427 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.cpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.cpp
@@ -70,6 +70,16 @@ namespace D3D8
resource->Release();
}
+ void *Direct3DSurface8::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void Direct3DSurface8::unlockInternal()
+ {
+ Surface::unlockInternal();
+ }
+
long Direct3DSurface8::QueryInterface(const IID &iid, void **object)
{
TRACE("");
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.hpp
index 279648013cc..e07829d9ba0 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DSurface8.hpp
@@ -31,22 +31,26 @@ namespace D3D8
public:
Direct3DSurface8(Direct3DDevice8 *device, Unknown *container, int width, int height, D3DFORMAT format, D3DPOOL pool, D3DMULTISAMPLE_TYPE multiSample, bool lockable, unsigned long usage);
- virtual ~Direct3DSurface8();
+ ~Direct3DSurface8() override;
+
+ // Surface methods
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
+ void unlockInternal() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DSurface8 methods
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetContainer(const IID &iid, void **container);
- long __stdcall GetDesc(D3DSURFACE_DESC *desc);
- long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags);
- long __stdcall UnlockRect();
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetContainer(const IID &iid, void **container) override;
+ long __stdcall GetDesc(D3DSURFACE_DESC *desc) override;
+ long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags) override;
+ long __stdcall UnlockRect() override;
// Internal methods
static sw::Format translateFormat(D3DFORMAT format);
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DSwapChain8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DSwapChain8.hpp
index 2a0c194f889..0501dbb1eb5 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DSwapChain8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DSwapChain8.hpp
@@ -30,20 +30,20 @@ namespace D3D8
public:
Direct3DSwapChain8(Direct3DDevice8 *device, D3DPRESENT_PARAMETERS *presentParameters);
- virtual ~Direct3DSwapChain8();
+ ~Direct3DSwapChain8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DSwapChain8 methods
- long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion);
- long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface8 **backBuffer);
+ long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion) override;
+ long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface8 **backBuffer) override;
// Internal methods
void reset(D3DPRESENT_PARAMETERS *presentParameters);
-
+
void screenshot(void *destBuffer);
void setGammaRamp(sw::GammaRamp *gammaRamp, bool calibrate);
void getGammaRamp(sw::GammaRamp *gammaRamp);
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DTexture8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DTexture8.hpp
index c031a27be3e..40f31a3fe0b 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DTexture8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DTexture8.hpp
@@ -27,37 +27,37 @@ namespace D3D8
{
class Direct3DTexture8 : public IDirect3DTexture8, public Direct3DBaseTexture8
{
- public:
+ public:
Direct3DTexture8(Direct3DDevice8 *device, unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DTexture8();
+ ~Direct3DTexture8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture methods
- unsigned long __stdcall GetLevelCount();
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall SetLOD(unsigned long newLOD);
+ unsigned long __stdcall GetLevelCount() override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// IDirect3DTexture8 methods
- long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description);
- long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags);
- long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface8 **surface);
- long __stdcall UnlockRect(unsigned int level);
- long __stdcall AddDirtyRect(const RECT *dirtyRect);
+ long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
+ long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
+ long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface8 **surface) override;
+ long __stdcall UnlockRect(unsigned int level) override;
+ long __stdcall AddDirtyRect(const RECT *dirtyRect) override;
// Internal methods
Direct3DSurface8 *getInternalSurfaceLevel(unsigned int level);
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexBuffer8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexBuffer8.hpp
index 435d01275c9..0aa59965b1b 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexBuffer8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexBuffer8.hpp
@@ -31,27 +31,27 @@ namespace D3D8
public:
Direct3DVertexBuffer8(Direct3DDevice8 *device, unsigned int length, unsigned long usage, long FVF, D3DPOOL pool);
- virtual ~Direct3DVertexBuffer8();
+ ~Direct3DVertexBuffer8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DVertexBuffer8 methods
- long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags);
- long __stdcall Unlock();
- long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description);
+ long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags) override;
+ long __stdcall Unlock() override;
+ long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description) override;
// Internal methods
int getLength() const;
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexDeclaration8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexDeclaration8.hpp
index 2b5b6656418..ff7c08f73d6 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexDeclaration8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexDeclaration8.hpp
@@ -28,12 +28,12 @@ namespace D3D8
public:
Direct3DVertexDeclaration8(Direct3DDevice8 *device, const unsigned long *vertexElements);
- virtual ~Direct3DVertexDeclaration8();
+ ~Direct3DVertexDeclaration8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// Internal methods
const unsigned long *getDeclaration() const;
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexShader8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexShader8.hpp
index 046f7b452d4..388bca02bea 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexShader8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DVertexShader8.hpp
@@ -29,12 +29,12 @@ namespace D3D8
public:
Direct3DVertexShader8(Direct3DDevice8 *device, const unsigned long *declaration, const unsigned long *shaderToken);
- virtual ~Direct3DVertexShader8();
+ ~Direct3DVertexShader8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// Internal methods
const sw::VertexShader *getVertexShader() const;
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.cpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.cpp
index 3fa78ad4d76..aa33ea1f8b0 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.cpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.cpp
@@ -33,6 +33,16 @@ namespace D3D8
resource->Release();
}
+ void *Direct3DVolume8::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void Direct3DVolume8::unlockInternal()
+ {
+ Surface::unlockInternal();
+ }
+
long __stdcall Direct3DVolume8::QueryInterface(const IID &iid, void **object)
{
TRACE("");
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.hpp
index 9b85fc765fc..ec5aba00a3b 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DVolume8.hpp
@@ -32,22 +32,26 @@ namespace D3D8
public:
Direct3DVolume8(Direct3DDevice8 *device, Direct3DVolumeTexture8 *container, int width, int height, int depth, D3DFORMAT format, D3DPOOL pool, bool locakble, unsigned long usage);
- virtual ~Direct3DVolume8();
+ ~Direct3DVolume8() override;
+
+ // Surface methods
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
+ void unlockInternal() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DVolume8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetContainer(const IID &iid, void **container);
- long __stdcall GetDesc(D3DVOLUME_DESC *description);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall UnlockBox();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetContainer(const IID &iid, void **container) override;
+ long __stdcall GetDesc(D3DVOLUME_DESC *description) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall UnlockBox() override;
private:
static sw::Format translateFormat(D3DFORMAT format);
diff --git a/chromium/third_party/swiftshader/src/D3D8/Direct3DVolumeTexture8.hpp b/chromium/third_party/swiftshader/src/D3D8/Direct3DVolumeTexture8.hpp
index fb0fbd75653..03ac1830c55 100644
--- a/chromium/third_party/swiftshader/src/D3D8/Direct3DVolumeTexture8.hpp
+++ b/chromium/third_party/swiftshader/src/D3D8/Direct3DVolumeTexture8.hpp
@@ -30,34 +30,34 @@ namespace D3D8
public:
Direct3DVolumeTexture8(Direct3DDevice8 *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DVolumeTexture8();
+ ~Direct3DVolumeTexture8() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource8 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice8 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice8 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture methods
- unsigned long __stdcall GetLevelCount();
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall SetLOD(unsigned long newLOD);
+ unsigned long __stdcall GetLevelCount() override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// IDirect3DVolumeTexture8 methods
- long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description);
- long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume8 **volume);
- long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags);
- long __stdcall UnlockBox(unsigned int level);
- long __stdcall AddDirtyBox(const D3DBOX *dirtyBox);
+ long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description) override;
+ long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume8 **volume) override;
+ long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
+ long __stdcall UnlockBox(unsigned int level) override;
+ long __stdcall AddDirtyBox(const D3DBOX *dirtyBox) override;
// Internal methods
Direct3DVolume8 *getInternalVolumeLevel(unsigned int level);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3D9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3D9.hpp
index f1543cc7189..0509dda6cb5 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3D9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3D9.hpp
@@ -29,28 +29,28 @@ namespace D3D9
public:
Direct3D9(int version, const HINSTANCE instance);
- virtual ~Direct3D9();
+ ~Direct3D9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3D9 methods
- long __stdcall RegisterSoftwareDevice(void *initializeFunction);
- unsigned int __stdcall GetAdapterCount();
- long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier);
- unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format);
- long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode);
- long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode);
- long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed);
- long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat);
- long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels);
- long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat);
- long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat);
- long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps);
- HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter);
- long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface);
+ long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
+ unsigned int __stdcall GetAdapterCount() override;
+ long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier) override;
+ unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format) override;
+ long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode) override;
+ long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
+ long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
+ long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
+ long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels) override;
+ long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
+ long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat) override;
+ long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps) override;
+ HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
+ long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface) override;
protected:
// Creation parameters
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3D9Ex.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3D9Ex.hpp
index a6589cfbfc1..8746cdf3566 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3D9Ex.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3D9Ex.hpp
@@ -29,35 +29,35 @@ namespace D3D9
public:
Direct3D9Ex(int version, const HINSTANCE instance);
- virtual ~Direct3D9Ex();
+ ~Direct3D9Ex() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3D9 methods
- long __stdcall RegisterSoftwareDevice(void *initializeFunction);
- unsigned int __stdcall GetAdapterCount();
- long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier);
- unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format);
- long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode);
- long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode);
- long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed);
- long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat);
- long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels);
- long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat);
- long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat);
- long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps);
- HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter);
- long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface);
+ long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
+ unsigned int __stdcall GetAdapterCount() override;
+ long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier) override;
+ unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format) override;
+ long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode) override;
+ long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
+ long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
+ long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
+ long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels) override;
+ long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
+ long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat) override;
+ long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps) override;
+ HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
+ long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface) override;
// IDirect3D9Ex methods
- unsigned int __stdcall GetAdapterModeCountEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter);
- long __stdcall EnumAdapterModesEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter, unsigned int index, D3DDISPLAYMODEEX *mode);
- long __stdcall GetAdapterDisplayModeEx(unsigned int adapter, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation);
- long __stdcall CreateDeviceEx(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, DWORD behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode, IDirect3DDevice9Ex **returnedDeviceInterface);
- long __stdcall GetAdapterLUID(unsigned int adapter, LUID *luid);
+ unsigned int __stdcall GetAdapterModeCountEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter) override;
+ long __stdcall EnumAdapterModesEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter, unsigned int index, D3DDISPLAYMODEEX *mode) override;
+ long __stdcall GetAdapterDisplayModeEx(unsigned int adapter, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation) override;
+ long __stdcall CreateDeviceEx(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, DWORD behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode, IDirect3DDevice9Ex **returnedDeviceInterface) override;
+ long __stdcall GetAdapterLUID(unsigned int adapter, LUID *luid) override;
private:
void loadSystemD3D9ex();
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DBaseTexture9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DBaseTexture9.hpp
index 52d0df7317a..1e75a14543d 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DBaseTexture9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DBaseTexture9.hpp
@@ -31,30 +31,30 @@ namespace D3D9
public:
Direct3DBaseTexture9(Direct3DDevice9 *device, D3DRESOURCETYPE type, D3DFORMAT format, D3DPOOL pool, unsigned long levels, unsigned long usage);
- virtual ~Direct3DBaseTexture9();
+ ~Direct3DBaseTexture9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- void __stdcall PreLoad();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ void __stdcall PreLoad() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods
- unsigned long __stdcall SetLOD(unsigned long newLOD);
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall GetLevelCount();
- long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType);
- D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType();
- void __stdcall GenerateMipSubLevels();
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall GetLevelCount() override;
+ long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
+ D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
+ void __stdcall GenerateMipSubLevels() override;
// Intenal methods
sw::Resource *getResource() const;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DCubeTexture9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DCubeTexture9.hpp
index b92bc74a9c6..21dedd5569f 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DCubeTexture9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DCubeTexture9.hpp
@@ -30,37 +30,37 @@ namespace D3D9
public:
Direct3DCubeTexture9(Direct3DDevice9 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DCubeTexture9();
+ ~Direct3DCubeTexture9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- void __stdcall PreLoad();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ void __stdcall PreLoad() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods
- unsigned long __stdcall SetLOD(unsigned long newLOD);
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall GetLevelCount();
- long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType);
- D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType();
- void __stdcall GenerateMipSubLevels();
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall GetLevelCount() override;
+ long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
+ D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
+ void __stdcall GenerateMipSubLevels() override;
// IDirect3DCubeTexture9 methods
- long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description);
- long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level, IDirect3DSurface9 **cubeMapSurface);
- long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags);
- long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level);
- long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect);
+ long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
+ long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level, IDirect3DSurface9 **cubeMapSurface) override;
+ long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
+ long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level) override;
+ long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect) override;
// Internal methods
Direct3DSurface9 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.cpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.cpp
index 126b0df6c84..9b68c47aa7b 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.cpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.cpp
@@ -2659,7 +2659,7 @@ namespace D3D9
void *bitmap = cursorSurface->lockExternal(0, 0, 0, sw::LOCK_READONLY, sw::PUBLIC);
delete cursor;
- cursor = new sw::Surface(0, width, height, 1, sw::FORMAT_A8R8G8B8, false, false);
+ cursor = sw::Surface::create(0, width, height, 1, sw::FORMAT_A8R8G8B8, false, false);
void *buffer = cursor->lockExternal(0, 0, 0, sw::LOCK_DISCARD, sw::PUBLIC);
memcpy(buffer, bitmap, width * height * sizeof(unsigned int));
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.hpp
index 4ca34426824..b5b7dc46363 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9.hpp
@@ -54,130 +54,130 @@ namespace D3D9
public:
Direct3DDevice9(const HINSTANCE instance, Direct3D9 *d3d9, unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviourFlags, D3DPRESENT_PARAMETERS *presentParameters);
- virtual ~Direct3DDevice9();
+ ~Direct3DDevice9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DDevice9 methods
- long __stdcall BeginScene();
- long __stdcall BeginStateBlock();
- long __stdcall Clear(unsigned long count, const D3DRECT *rects, unsigned long flags, unsigned long color, float z, unsigned long stencil);
- long __stdcall ColorFill(IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color);
- long __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *presentParameters, IDirect3DSwapChain9 **swapChain);
- long __stdcall CreateCubeTexture(unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture9 **cubeTexture, void **sharedHandle);
- long __stdcall CreateDepthStencilSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int discard, IDirect3DSurface9 **surface, void **sharedHandle);
- long __stdcall CreateIndexBuffer(unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **indexBuffer, void **sharedHandle);
- long __stdcall CreateOffscreenPlainSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, void **sharedHandle);
- long __stdcall CreatePixelShader(const unsigned long *function, IDirect3DPixelShader9 **shader);
- long __stdcall CreateQuery(D3DQUERYTYPE type, IDirect3DQuery9 **query);
- long __stdcall CreateRenderTarget(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int lockable, IDirect3DSurface9 **surface, void **sharedHandle);
- long __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateBlock);
- long __stdcall CreateTexture(unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture9 **texture, void **sharedHandle);
- long __stdcall CreateVertexBuffer(unsigned int length, unsigned long usage, unsigned long FVF, D3DPOOL pool, IDirect3DVertexBuffer9 **vertexBuffer, void **sharedHandle);
- long __stdcall CreateVertexDeclaration(const D3DVERTEXELEMENT9 *vertexElements, IDirect3DVertexDeclaration9 **declaration);
- long __stdcall CreateVertexShader(const unsigned long *function, IDirect3DVertexShader9 **shader);
- long __stdcall CreateVolumeTexture(unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture9 **volumeTexture, void **sharedHandle);
- long __stdcall DeletePatch(unsigned int handle);
- long __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE type, int baseVertexIndex, unsigned int minIndex, unsigned int numVertices, unsigned int startIndex, unsigned int primitiveCount);
- long __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE type, unsigned int minVertexIndex, unsigned int numVertexIndices, unsigned int PrimitiveCount, const void *indexData, D3DFORMAT indexDataFormat, const void *vertexStreamZeroData, unsigned int VertexStreamZeroStride);
- long __stdcall DrawPrimitive(D3DPRIMITIVETYPE primitiveType, unsigned int startVertex, unsigned int primiveCount);
- long __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE primitiveType, unsigned int primitiveCount, const void *vertexStreamZeroData, unsigned int vertexStreamZeroStride);
- long __stdcall DrawRectPatch(unsigned int handle, const float *numSegs, const D3DRECTPATCH_INFO *rectPatchInfo);
- long __stdcall DrawTriPatch(unsigned int handle, const float *numSegs, const D3DTRIPATCH_INFO *triPatchInfo);
- long __stdcall EndScene();
- long __stdcall EndStateBlock(IDirect3DStateBlock9 **stateBlock);
- long __stdcall EvictManagedResources();
- unsigned int __stdcall GetAvailableTextureMem();
- long __stdcall GetBackBuffer(unsigned int swapChain, unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer);
- long __stdcall GetClipPlane(unsigned long index, float *plane);
- long __stdcall GetClipStatus(D3DCLIPSTATUS9 *clipStatus);
- long __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *parameters);
- long __stdcall GetCurrentTexturePalette(unsigned int *paletteNumber);
- long __stdcall GetDepthStencilSurface(IDirect3DSurface9 **depthStencilSurface);
- long __stdcall GetDeviceCaps(D3DCAPS9 *caps);
- long __stdcall GetDirect3D(IDirect3D9 **D3D);
- long __stdcall GetDisplayMode(unsigned int swapChain ,D3DDISPLAYMODE *mode);
- long __stdcall GetFrontBufferData(unsigned int swapChain, IDirect3DSurface9 *destSurface);
- long __stdcall GetFVF(unsigned long *FVF);
- void __stdcall GetGammaRamp(unsigned int swapChain, D3DGAMMARAMP *ramp);
- long __stdcall GetIndices(IDirect3DIndexBuffer9 **indexData);
- long __stdcall GetLight(unsigned long index, D3DLIGHT9 *p);
- long __stdcall GetLightEnable(unsigned long index , int *enable);
- long __stdcall GetMaterial(D3DMATERIAL9 *material);
- float __stdcall GetNPatchMode();
- unsigned int __stdcall GetNumberOfSwapChains();
- long __stdcall GetPaletteEntries(unsigned int paletteNumber, PALETTEENTRY *entries);
- long __stdcall GetPixelShader(IDirect3DPixelShader9 **shader);
- long __stdcall GetPixelShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall GetPixelShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count);
- long __stdcall GetPixelShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall GetRasterStatus(unsigned int swapChain, D3DRASTER_STATUS *rasterStatus);
- long __stdcall GetRenderState(D3DRENDERSTATETYPE State, unsigned long *value);
- long __stdcall GetRenderTarget(unsigned long index, IDirect3DSurface9 **renderTarget);
- long __stdcall GetRenderTargetData(IDirect3DSurface9 *renderTarget, IDirect3DSurface9 *destSurface);
- long __stdcall GetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE type, unsigned long *value);
- long __stdcall GetScissorRect(RECT *rect);
- int __stdcall GetSoftwareVertexProcessing();
- long __stdcall GetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer9 **streamData, unsigned int *offset, unsigned int *stride);
- long __stdcall GetStreamSourceFreq(unsigned int streamNumber, unsigned int *divider);
- long __stdcall GetSwapChain(unsigned int index, IDirect3DSwapChain9 **swapChain);
- long __stdcall GetTexture(unsigned long sampler, IDirect3DBaseTexture9 **texture);
- long __stdcall GetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long *value);
- long __stdcall GetTransform(D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix);
- long __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9 **declaration);
- long __stdcall GetVertexShader(IDirect3DVertexShader9 **shader);
- long __stdcall GetVertexShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall GetVertexShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count);
- long __stdcall GetVertexShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall GetViewport(D3DVIEWPORT9 *viewport);
- long __stdcall LightEnable(unsigned long index, int enable);
- long __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix);
- long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion);
- long __stdcall ProcessVertices(unsigned int srcStartIndex, unsigned int destIndex, unsigned int vertexCount, IDirect3DVertexBuffer9 *destBuffer, IDirect3DVertexDeclaration9 *vertexDeclaration, unsigned long flags);
- long __stdcall Reset(D3DPRESENT_PARAMETERS *presentParameters);
- long __stdcall SetClipPlane(unsigned long index, const float *plane);
- long __stdcall SetClipStatus(const D3DCLIPSTATUS9 *clipStatus);
- long __stdcall SetCurrentTexturePalette(unsigned int paletteNumber);
- void __stdcall SetCursorPosition(int x, int y, unsigned long flags);
- long __stdcall SetCursorProperties(unsigned int x, unsigned int y, IDirect3DSurface9 *cursorBitmap);
- long __stdcall SetDepthStencilSurface(IDirect3DSurface9 *newDepthStencil);
- long __stdcall SetDialogBoxMode(int enableDialogs);
- long __stdcall SetFVF(unsigned long FVF);
- void __stdcall SetGammaRamp(unsigned int swapChain, unsigned long flags, const D3DGAMMARAMP *ramp);
- long __stdcall SetIndices(IDirect3DIndexBuffer9 *indexData);
- long __stdcall SetLight(unsigned long index, const D3DLIGHT9 *light);
- long __stdcall SetMaterial(const D3DMATERIAL9 *material);
- long __stdcall SetNPatchMode(float segments);
- long __stdcall SetPaletteEntries(unsigned int paletteNumber, const PALETTEENTRY *entries);
- long __stdcall SetPixelShader(IDirect3DPixelShader9 *shader);
- long __stdcall SetPixelShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall SetPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
- long __stdcall SetPixelShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall SetRenderState(D3DRENDERSTATETYPE state, unsigned long value);
- long __stdcall SetRenderTarget(unsigned long index, IDirect3DSurface9 *renderTarget);
- long __stdcall SetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE state, unsigned long value);
- long __stdcall SetScissorRect(const RECT *rect);
- long __stdcall SetSoftwareVertexProcessing(int software);
- long __stdcall SetStreamSource(unsigned int stream, IDirect3DVertexBuffer9 *data, unsigned int offset, unsigned int stride);
- long __stdcall SetStreamSourceFreq(unsigned int streamNumber, unsigned int divider);
- long __stdcall SetTexture(unsigned long sampler, IDirect3DBaseTexture9 *texture);
- long __stdcall SetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long value);
- long __stdcall SetTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix);
- long __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9 *declaration);
- long __stdcall SetVertexShader(IDirect3DVertexShader9 *shader);
- long __stdcall SetVertexShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall SetVertexShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
- long __stdcall SetVertexShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall SetViewport(const D3DVIEWPORT9 *viewport);
- int __stdcall ShowCursor(int show);
- long __stdcall StretchRect(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destSurface, const RECT *destRect, D3DTEXTUREFILTERTYPE filter);
- long __stdcall TestCooperativeLevel();
- long __stdcall UpdateSurface(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destinationSurface, const POINT *destPoint);
- long __stdcall UpdateTexture(IDirect3DBaseTexture9 *sourceTexture, IDirect3DBaseTexture9 *destinationTexture);
- long __stdcall ValidateDevice(unsigned long *numPasses);
+ long __stdcall BeginScene() override;
+ long __stdcall BeginStateBlock() override;
+ long __stdcall Clear(unsigned long count, const D3DRECT *rects, unsigned long flags, unsigned long color, float z, unsigned long stencil) override;
+ long __stdcall ColorFill(IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color) override;
+ long __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *presentParameters, IDirect3DSwapChain9 **swapChain) override;
+ long __stdcall CreateCubeTexture(unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture9 **cubeTexture, void **sharedHandle) override;
+ long __stdcall CreateDepthStencilSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int discard, IDirect3DSurface9 **surface, void **sharedHandle) override;
+ long __stdcall CreateIndexBuffer(unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **indexBuffer, void **sharedHandle) override;
+ long __stdcall CreateOffscreenPlainSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, void **sharedHandle) override;
+ long __stdcall CreatePixelShader(const unsigned long *function, IDirect3DPixelShader9 **shader) override;
+ long __stdcall CreateQuery(D3DQUERYTYPE type, IDirect3DQuery9 **query) override;
+ long __stdcall CreateRenderTarget(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int lockable, IDirect3DSurface9 **surface, void **sharedHandle) override;
+ long __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateBlock) override;
+ long __stdcall CreateTexture(unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture9 **texture, void **sharedHandle) override;
+ long __stdcall CreateVertexBuffer(unsigned int length, unsigned long usage, unsigned long FVF, D3DPOOL pool, IDirect3DVertexBuffer9 **vertexBuffer, void **sharedHandle) override;
+ long __stdcall CreateVertexDeclaration(const D3DVERTEXELEMENT9 *vertexElements, IDirect3DVertexDeclaration9 **declaration) override;
+ long __stdcall CreateVertexShader(const unsigned long *function, IDirect3DVertexShader9 **shader) override;
+ long __stdcall CreateVolumeTexture(unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture9 **volumeTexture, void **sharedHandle) override;
+ long __stdcall DeletePatch(unsigned int handle) override;
+ long __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE type, int baseVertexIndex, unsigned int minIndex, unsigned int numVertices, unsigned int startIndex, unsigned int primitiveCount) override;
+ long __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE type, unsigned int minVertexIndex, unsigned int numVertexIndices, unsigned int PrimitiveCount, const void *indexData, D3DFORMAT indexDataFormat, const void *vertexStreamZeroData, unsigned int VertexStreamZeroStride) override;
+ long __stdcall DrawPrimitive(D3DPRIMITIVETYPE primitiveType, unsigned int startVertex, unsigned int primiveCount) override;
+ long __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE primitiveType, unsigned int primitiveCount, const void *vertexStreamZeroData, unsigned int vertexStreamZeroStride) override;
+ long __stdcall DrawRectPatch(unsigned int handle, const float *numSegs, const D3DRECTPATCH_INFO *rectPatchInfo) override;
+ long __stdcall DrawTriPatch(unsigned int handle, const float *numSegs, const D3DTRIPATCH_INFO *triPatchInfo) override;
+ long __stdcall EndScene() override;
+ long __stdcall EndStateBlock(IDirect3DStateBlock9 **stateBlock) override;
+ long __stdcall EvictManagedResources() override;
+ unsigned int __stdcall GetAvailableTextureMem() override;
+ long __stdcall GetBackBuffer(unsigned int swapChain, unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer) override;
+ long __stdcall GetClipPlane(unsigned long index, float *plane) override;
+ long __stdcall GetClipStatus(D3DCLIPSTATUS9 *clipStatus) override;
+ long __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *parameters) override;
+ long __stdcall GetCurrentTexturePalette(unsigned int *paletteNumber) override;
+ long __stdcall GetDepthStencilSurface(IDirect3DSurface9 **depthStencilSurface) override;
+ long __stdcall GetDeviceCaps(D3DCAPS9 *caps) override;
+ long __stdcall GetDirect3D(IDirect3D9 **D3D) override;
+ long __stdcall GetDisplayMode(unsigned int swapChain ,D3DDISPLAYMODE *mode) override;
+ long __stdcall GetFrontBufferData(unsigned int swapChain, IDirect3DSurface9 *destSurface) override;
+ long __stdcall GetFVF(unsigned long *FVF) override;
+ void __stdcall GetGammaRamp(unsigned int swapChain, D3DGAMMARAMP *ramp) override;
+ long __stdcall GetIndices(IDirect3DIndexBuffer9 **indexData) override;
+ long __stdcall GetLight(unsigned long index, D3DLIGHT9 *p) override;
+ long __stdcall GetLightEnable(unsigned long index , int *enable) override;
+ long __stdcall GetMaterial(D3DMATERIAL9 *material) override;
+ float __stdcall GetNPatchMode() override;
+ unsigned int __stdcall GetNumberOfSwapChains() override;
+ long __stdcall GetPaletteEntries(unsigned int paletteNumber, PALETTEENTRY *entries) override;
+ long __stdcall GetPixelShader(IDirect3DPixelShader9 **shader) override;
+ long __stdcall GetPixelShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall GetPixelShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count) override;
+ long __stdcall GetPixelShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall GetRasterStatus(unsigned int swapChain, D3DRASTER_STATUS *rasterStatus) override;
+ long __stdcall GetRenderState(D3DRENDERSTATETYPE State, unsigned long *value) override;
+ long __stdcall GetRenderTarget(unsigned long index, IDirect3DSurface9 **renderTarget) override;
+ long __stdcall GetRenderTargetData(IDirect3DSurface9 *renderTarget, IDirect3DSurface9 *destSurface) override;
+ long __stdcall GetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE type, unsigned long *value) override;
+ long __stdcall GetScissorRect(RECT *rect) override;
+ int __stdcall GetSoftwareVertexProcessing() override;
+ long __stdcall GetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer9 **streamData, unsigned int *offset, unsigned int *stride) override;
+ long __stdcall GetStreamSourceFreq(unsigned int streamNumber, unsigned int *divider) override;
+ long __stdcall GetSwapChain(unsigned int index, IDirect3DSwapChain9 **swapChain) override;
+ long __stdcall GetTexture(unsigned long sampler, IDirect3DBaseTexture9 **texture) override;
+ long __stdcall GetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long *value) override;
+ long __stdcall GetTransform(D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix) override;
+ long __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9 **declaration) override;
+ long __stdcall GetVertexShader(IDirect3DVertexShader9 **shader) override;
+ long __stdcall GetVertexShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall GetVertexShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count) override;
+ long __stdcall GetVertexShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall GetViewport(D3DVIEWPORT9 *viewport) override;
+ long __stdcall LightEnable(unsigned long index, int enable) override;
+ long __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) override;
+ long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion) override;
+ long __stdcall ProcessVertices(unsigned int srcStartIndex, unsigned int destIndex, unsigned int vertexCount, IDirect3DVertexBuffer9 *destBuffer, IDirect3DVertexDeclaration9 *vertexDeclaration, unsigned long flags) override;
+ long __stdcall Reset(D3DPRESENT_PARAMETERS *presentParameters) override;
+ long __stdcall SetClipPlane(unsigned long index, const float *plane) override;
+ long __stdcall SetClipStatus(const D3DCLIPSTATUS9 *clipStatus) override;
+ long __stdcall SetCurrentTexturePalette(unsigned int paletteNumber) override;
+ void __stdcall SetCursorPosition(int x, int y, unsigned long flags) override;
+ long __stdcall SetCursorProperties(unsigned int x, unsigned int y, IDirect3DSurface9 *cursorBitmap) override;
+ long __stdcall SetDepthStencilSurface(IDirect3DSurface9 *newDepthStencil) override;
+ long __stdcall SetDialogBoxMode(int enableDialogs) override;
+ long __stdcall SetFVF(unsigned long FVF) override;
+ void __stdcall SetGammaRamp(unsigned int swapChain, unsigned long flags, const D3DGAMMARAMP *ramp) override;
+ long __stdcall SetIndices(IDirect3DIndexBuffer9 *indexData) override;
+ long __stdcall SetLight(unsigned long index, const D3DLIGHT9 *light) override;
+ long __stdcall SetMaterial(const D3DMATERIAL9 *material) override;
+ long __stdcall SetNPatchMode(float segments) override;
+ long __stdcall SetPaletteEntries(unsigned int paletteNumber, const PALETTEENTRY *entries) override;
+ long __stdcall SetPixelShader(IDirect3DPixelShader9 *shader) override;
+ long __stdcall SetPixelShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall SetPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count) override;
+ long __stdcall SetPixelShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall SetRenderState(D3DRENDERSTATETYPE state, unsigned long value) override;
+ long __stdcall SetRenderTarget(unsigned long index, IDirect3DSurface9 *renderTarget) override;
+ long __stdcall SetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE state, unsigned long value) override;
+ long __stdcall SetScissorRect(const RECT *rect) override;
+ long __stdcall SetSoftwareVertexProcessing(int software) override;
+ long __stdcall SetStreamSource(unsigned int stream, IDirect3DVertexBuffer9 *data, unsigned int offset, unsigned int stride) override;
+ long __stdcall SetStreamSourceFreq(unsigned int streamNumber, unsigned int divider) override;
+ long __stdcall SetTexture(unsigned long sampler, IDirect3DBaseTexture9 *texture) override;
+ long __stdcall SetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long value) override;
+ long __stdcall SetTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) override;
+ long __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9 *declaration) override;
+ long __stdcall SetVertexShader(IDirect3DVertexShader9 *shader) override;
+ long __stdcall SetVertexShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall SetVertexShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count) override;
+ long __stdcall SetVertexShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall SetViewport(const D3DVIEWPORT9 *viewport) override;
+ int __stdcall ShowCursor(int show) override;
+ long __stdcall StretchRect(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destSurface, const RECT *destRect, D3DTEXTUREFILTERTYPE filter) override;
+ long __stdcall TestCooperativeLevel() override;
+ long __stdcall UpdateSurface(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destinationSurface, const POINT *destPoint) override;
+ long __stdcall UpdateTexture(IDirect3DBaseTexture9 *sourceTexture, IDirect3DBaseTexture9 *destinationTexture) override;
+ long __stdcall ValidateDevice(unsigned long *numPasses) override;
// Internal methods
long getAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9Ex.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9Ex.hpp
index ce34a9575df..4a28df52350 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9Ex.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DDevice9Ex.hpp
@@ -49,147 +49,147 @@ namespace D3D9
public:
Direct3DDevice9Ex(const HINSTANCE instance, Direct3D9Ex *d3d9ex, unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviourFlags, D3DPRESENT_PARAMETERS *presentParameters);
- virtual ~Direct3DDevice9Ex();
+ ~Direct3DDevice9Ex() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DDevice9 methods
- long __stdcall TestCooperativeLevel();
- unsigned int __stdcall GetAvailableTextureMem();
- long __stdcall EvictManagedResources();
- long __stdcall GetDirect3D(IDirect3D9 **D3D);
- long __stdcall GetDeviceCaps(D3DCAPS9 *caps);
- long __stdcall GetDisplayMode(unsigned int swapChain ,D3DDISPLAYMODE *mode);
- long __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *parameters);
- long __stdcall SetCursorProperties(unsigned int x, unsigned int y, IDirect3DSurface9 *cursorBitmap);
- void __stdcall SetCursorPosition(int x, int y, unsigned long flags);
- int __stdcall ShowCursor(int show);
- long __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *presentParameters, IDirect3DSwapChain9 **swapChain);
- long __stdcall GetSwapChain(unsigned int index, IDirect3DSwapChain9 **swapChain);
- unsigned int __stdcall GetNumberOfSwapChains();
- long __stdcall Reset(D3DPRESENT_PARAMETERS *presentParameters);
- long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion);
- long __stdcall GetBackBuffer(unsigned int swapChain, unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer);
- long __stdcall GetRasterStatus(unsigned int swapChain, D3DRASTER_STATUS *rasterStatus);
- long __stdcall SetDialogBoxMode(int enableDialogs);
- void __stdcall SetGammaRamp(unsigned int swapChain, unsigned long flags, const D3DGAMMARAMP *ramp);
- void __stdcall GetGammaRamp(unsigned int swapChain, D3DGAMMARAMP *ramp);
- long __stdcall CreateTexture(unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture9 **texture, void **sharedHandle);
- long __stdcall CreateVolumeTexture(unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture9 **volumeTexture, void **sharedHandle);
- long __stdcall CreateCubeTexture(unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture9 **cubeTexture, void **sharedHandle);
- long __stdcall CreateVertexBuffer(unsigned int length, unsigned long usage, unsigned long FVF, D3DPOOL, IDirect3DVertexBuffer9 **vertexBuffer, void **sharedHandle);
- long __stdcall CreateIndexBuffer(unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **indexBuffer, void **sharedHandle);
- long __stdcall CreateRenderTarget(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int lockable, IDirect3DSurface9 **surface, void **sharedHandle);
- long __stdcall CreateDepthStencilSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int discard, IDirect3DSurface9 **surface, void **sharedHandle);
- long __stdcall UpdateSurface(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destinationSurface, const POINT *destPoint);
- long __stdcall UpdateTexture(IDirect3DBaseTexture9 *sourceTexture, IDirect3DBaseTexture9 *destinationTexture);
- long __stdcall GetRenderTargetData(IDirect3DSurface9 *renderTarget, IDirect3DSurface9 *destSurface);
- long __stdcall GetFrontBufferData(unsigned int swapChain, IDirect3DSurface9 *destSurface);
- long __stdcall StretchRect(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destSurface, const RECT *destRect, D3DTEXTUREFILTERTYPE filter);
- long __stdcall ColorFill(IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color);
- long __stdcall CreateOffscreenPlainSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, void **sharedHandle);
- long __stdcall SetRenderTarget(unsigned long index, IDirect3DSurface9 *renderTarget);
- long __stdcall GetRenderTarget(unsigned long index, IDirect3DSurface9 **renderTarget);
- long __stdcall SetDepthStencilSurface(IDirect3DSurface9 *newDepthStencil);
- long __stdcall GetDepthStencilSurface(IDirect3DSurface9 **depthStencilSurface);
- long __stdcall BeginScene();
- long __stdcall EndScene();
- long __stdcall Clear(unsigned long Count, const D3DRECT *rects, unsigned long Flags, unsigned long Color, float Z, unsigned long Stencil);
- long __stdcall SetTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix);
- long __stdcall GetTransform(D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix);
- long __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix);
- long __stdcall SetViewport(const D3DVIEWPORT9 *viewport);
- long __stdcall GetViewport(D3DVIEWPORT9 *viewport);
- long __stdcall SetMaterial(const D3DMATERIAL9 *material);
- long __stdcall GetMaterial(D3DMATERIAL9 *material);
- long __stdcall SetLight(unsigned long index, const D3DLIGHT9 *light);
- long __stdcall GetLight(unsigned long index, D3DLIGHT9 *light);
- long __stdcall LightEnable(unsigned long index, int enable);
- long __stdcall GetLightEnable(unsigned long index , int *enable);
- long __stdcall SetClipPlane(unsigned long index, const float *plane);
- long __stdcall GetClipPlane(unsigned long index, float *plane);
- long __stdcall SetRenderState(D3DRENDERSTATETYPE state, unsigned long value);
- long __stdcall GetRenderState(D3DRENDERSTATETYPE State, unsigned long *value);
- long __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateBlock);
- long __stdcall BeginStateBlock();
- long __stdcall EndStateBlock(IDirect3DStateBlock9 **stateBlock);
- long __stdcall SetClipStatus(const D3DCLIPSTATUS9 *clipStatus);
- long __stdcall GetClipStatus(D3DCLIPSTATUS9 *clipStatus);
- long __stdcall GetTexture(unsigned long sampler, IDirect3DBaseTexture9 **texture);
- long __stdcall SetTexture(unsigned long sampler, IDirect3DBaseTexture9 *texture);
- long __stdcall GetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long *value);
- long __stdcall SetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long value);
- long __stdcall GetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE state, unsigned long *value);
- long __stdcall SetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE state, unsigned long value);
- long __stdcall ValidateDevice(unsigned long *numPasses);
- long __stdcall SetPaletteEntries(unsigned int paletteNumber, const PALETTEENTRY *entries);
- long __stdcall GetPaletteEntries(unsigned int paletteNumber, PALETTEENTRY *entries);
- long __stdcall SetCurrentTexturePalette(unsigned int paletteNumber);
- long __stdcall GetCurrentTexturePalette(unsigned int *paletteNumber);
- long __stdcall SetScissorRect(const RECT *rect);
- long __stdcall GetScissorRect(RECT *rect);
- long __stdcall SetSoftwareVertexProcessing(int software);
- int __stdcall GetSoftwareVertexProcessing();
- long __stdcall SetNPatchMode(float segments);
- float __stdcall GetNPatchMode();
- long __stdcall DrawPrimitive(D3DPRIMITIVETYPE primitiveType, unsigned int startVertex, unsigned int primiveCount);
- long __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE type, int baseVertexIndex, unsigned int minIndex, unsigned int numVertices, unsigned int startIndex, unsigned int primitiveCount);
- long __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE primitiveType, unsigned int primitiveCount, const void *vertexStreamZeroData, unsigned int vertexStreamZeroStride);
- long __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE type, unsigned int minVertexIndex, unsigned int numVertexIndices, unsigned int PrimitiveCount, const void *indexData, D3DFORMAT indexDataFormat, const void *vertexStreamZeroData, unsigned int VertexStreamZeroStride);
- long __stdcall ProcessVertices(unsigned int srcStartIndex, unsigned int destIndex, unsigned int vertexCount, IDirect3DVertexBuffer9 *destBuffer, IDirect3DVertexDeclaration9 *vertexDeclaration, unsigned long flags);
- long __stdcall CreateVertexDeclaration(const D3DVERTEXELEMENT9 *vertexElements, IDirect3DVertexDeclaration9 **declaration);
- long __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9 *declaration);
- long __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9 **declaration);
- long __stdcall SetFVF(unsigned long FVF);
- long __stdcall GetFVF(unsigned long *FVF);
- long __stdcall CreateVertexShader(const unsigned long *function, IDirect3DVertexShader9 **shader);
- long __stdcall SetVertexShader(IDirect3DVertexShader9 *shader);
- long __stdcall GetVertexShader(IDirect3DVertexShader9 **shader);
- long __stdcall SetVertexShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
- long __stdcall GetVertexShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count);
- long __stdcall SetVertexShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall GetVertexShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall SetVertexShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall GetVertexShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall SetStreamSource(unsigned int stream, IDirect3DVertexBuffer9 *data, unsigned int offset, unsigned int stride);
- long __stdcall GetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer9 **streamData, unsigned int *offset, unsigned int *stride);
- long __stdcall SetStreamSourceFreq(unsigned int streamNumber, unsigned int divider);
- long __stdcall GetStreamSourceFreq(unsigned int streamNumber, unsigned int *divider);
- long __stdcall SetIndices(IDirect3DIndexBuffer9 *indexData);
- long __stdcall GetIndices(IDirect3DIndexBuffer9 **indexData);
- long __stdcall CreatePixelShader(const unsigned long *function, IDirect3DPixelShader9 **shader);
- long __stdcall SetPixelShader(IDirect3DPixelShader9 *shader);
- long __stdcall GetPixelShader(IDirect3DPixelShader9 **shader);
- long __stdcall SetPixelShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall GetPixelShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall SetPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
- long __stdcall GetPixelShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count);
- long __stdcall SetPixelShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count);
- long __stdcall GetPixelShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count);
- long __stdcall DrawRectPatch(unsigned int handle, const float *numSegs, const D3DRECTPATCH_INFO *rectPatchInfo);
- long __stdcall DrawTriPatch(unsigned int handle, const float *numSegs, const D3DTRIPATCH_INFO *triPatchInfo);
- long __stdcall DeletePatch(unsigned int handle);
- long __stdcall CreateQuery(D3DQUERYTYPE type, IDirect3DQuery9 **query);
-
+ long __stdcall TestCooperativeLevel() override;
+ unsigned int __stdcall GetAvailableTextureMem() override;
+ long __stdcall EvictManagedResources() override;
+ long __stdcall GetDirect3D(IDirect3D9 **D3D) override;
+ long __stdcall GetDeviceCaps(D3DCAPS9 *caps) override;
+ long __stdcall GetDisplayMode(unsigned int swapChain ,D3DDISPLAYMODE *mode) override;
+ long __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *parameters) override;
+ long __stdcall SetCursorProperties(unsigned int x, unsigned int y, IDirect3DSurface9 *cursorBitmap) override;
+ void __stdcall SetCursorPosition(int x, int y, unsigned long flags) override;
+ int __stdcall ShowCursor(int show) override;
+ long __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *presentParameters, IDirect3DSwapChain9 **swapChain) override;
+ long __stdcall GetSwapChain(unsigned int index, IDirect3DSwapChain9 **swapChain) override;
+ unsigned int __stdcall GetNumberOfSwapChains() override;
+ long __stdcall Reset(D3DPRESENT_PARAMETERS *presentParameters) override;
+ long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion) override;
+ long __stdcall GetBackBuffer(unsigned int swapChain, unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer) override;
+ long __stdcall GetRasterStatus(unsigned int swapChain, D3DRASTER_STATUS *rasterStatus) override;
+ long __stdcall SetDialogBoxMode(int enableDialogs) override;
+ void __stdcall SetGammaRamp(unsigned int swapChain, unsigned long flags, const D3DGAMMARAMP *ramp) override;
+ void __stdcall GetGammaRamp(unsigned int swapChain, D3DGAMMARAMP *ramp) override;
+ long __stdcall CreateTexture(unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture9 **texture, void **sharedHandle) override;
+ long __stdcall CreateVolumeTexture(unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture9 **volumeTexture, void **sharedHandle) override;
+ long __stdcall CreateCubeTexture(unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture9 **cubeTexture, void **sharedHandle) override;
+ long __stdcall CreateVertexBuffer(unsigned int length, unsigned long usage, unsigned long FVF, D3DPOOL, IDirect3DVertexBuffer9 **vertexBuffer, void **sharedHandle) override;
+ long __stdcall CreateIndexBuffer(unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **indexBuffer, void **sharedHandle) override;
+ long __stdcall CreateRenderTarget(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int lockable, IDirect3DSurface9 **surface, void **sharedHandle) override;
+ long __stdcall CreateDepthStencilSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSample, unsigned long multiSampleQuality, int discard, IDirect3DSurface9 **surface, void **sharedHandle) override;
+ long __stdcall UpdateSurface(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destinationSurface, const POINT *destPoint) override;
+ long __stdcall UpdateTexture(IDirect3DBaseTexture9 *sourceTexture, IDirect3DBaseTexture9 *destinationTexture) override;
+ long __stdcall GetRenderTargetData(IDirect3DSurface9 *renderTarget, IDirect3DSurface9 *destSurface) override;
+ long __stdcall GetFrontBufferData(unsigned int swapChain, IDirect3DSurface9 *destSurface) override;
+ long __stdcall StretchRect(IDirect3DSurface9 *sourceSurface, const RECT *sourceRect, IDirect3DSurface9 *destSurface, const RECT *destRect, D3DTEXTUREFILTERTYPE filter) override;
+ long __stdcall ColorFill(IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color) override;
+ long __stdcall CreateOffscreenPlainSurface(unsigned int width, unsigned int height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, void **sharedHandle) override;
+ long __stdcall SetRenderTarget(unsigned long index, IDirect3DSurface9 *renderTarget) override;
+ long __stdcall GetRenderTarget(unsigned long index, IDirect3DSurface9 **renderTarget) override;
+ long __stdcall SetDepthStencilSurface(IDirect3DSurface9 *newDepthStencil) override;
+ long __stdcall GetDepthStencilSurface(IDirect3DSurface9 **depthStencilSurface) override;
+ long __stdcall BeginScene() override;
+ long __stdcall EndScene() override;
+ long __stdcall Clear(unsigned long Count, const D3DRECT *rects, unsigned long Flags, unsigned long Color, float Z, unsigned long Stencil) override;
+ long __stdcall SetTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) override;
+ long __stdcall GetTransform(D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix) override;
+ long __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) override;
+ long __stdcall SetViewport(const D3DVIEWPORT9 *viewport) override;
+ long __stdcall GetViewport(D3DVIEWPORT9 *viewport) override;
+ long __stdcall SetMaterial(const D3DMATERIAL9 *material) override;
+ long __stdcall GetMaterial(D3DMATERIAL9 *material) override;
+ long __stdcall SetLight(unsigned long index, const D3DLIGHT9 *light) override;
+ long __stdcall GetLight(unsigned long index, D3DLIGHT9 *light) override;
+ long __stdcall LightEnable(unsigned long index, int enable) override;
+ long __stdcall GetLightEnable(unsigned long index , int *enable) override;
+ long __stdcall SetClipPlane(unsigned long index, const float *plane) override;
+ long __stdcall GetClipPlane(unsigned long index, float *plane) override;
+ long __stdcall SetRenderState(D3DRENDERSTATETYPE state, unsigned long value) override;
+ long __stdcall GetRenderState(D3DRENDERSTATETYPE State, unsigned long *value) override;
+ long __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateBlock) override;
+ long __stdcall BeginStateBlock() override;
+ long __stdcall EndStateBlock(IDirect3DStateBlock9 **stateBlock) override;
+ long __stdcall SetClipStatus(const D3DCLIPSTATUS9 *clipStatus) override;
+ long __stdcall GetClipStatus(D3DCLIPSTATUS9 *clipStatus) override;
+ long __stdcall GetTexture(unsigned long sampler, IDirect3DBaseTexture9 **texture) override;
+ long __stdcall SetTexture(unsigned long sampler, IDirect3DBaseTexture9 *texture) override;
+ long __stdcall GetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long *value) override;
+ long __stdcall SetTextureStageState(unsigned long stage, D3DTEXTURESTAGESTATETYPE type, unsigned long value) override;
+ long __stdcall GetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE state, unsigned long *value) override;
+ long __stdcall SetSamplerState(unsigned long sampler, D3DSAMPLERSTATETYPE state, unsigned long value) override;
+ long __stdcall ValidateDevice(unsigned long *numPasses) override;
+ long __stdcall SetPaletteEntries(unsigned int paletteNumber, const PALETTEENTRY *entries) override;
+ long __stdcall GetPaletteEntries(unsigned int paletteNumber, PALETTEENTRY *entries) override;
+ long __stdcall SetCurrentTexturePalette(unsigned int paletteNumber) override;
+ long __stdcall GetCurrentTexturePalette(unsigned int *paletteNumber) override;
+ long __stdcall SetScissorRect(const RECT *rect) override;
+ long __stdcall GetScissorRect(RECT *rect) override;
+ long __stdcall SetSoftwareVertexProcessing(int software) override;
+ int __stdcall GetSoftwareVertexProcessing() override;
+ long __stdcall SetNPatchMode(float segments) override;
+ float __stdcall GetNPatchMode() override;
+ long __stdcall DrawPrimitive(D3DPRIMITIVETYPE primitiveType, unsigned int startVertex, unsigned int primiveCount) override;
+ long __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE type, int baseVertexIndex, unsigned int minIndex, unsigned int numVertices, unsigned int startIndex, unsigned int primitiveCount) override;
+ long __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE primitiveType, unsigned int primitiveCount, const void *vertexStreamZeroData, unsigned int vertexStreamZeroStride) override;
+ long __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE type, unsigned int minVertexIndex, unsigned int numVertexIndices, unsigned int PrimitiveCount, const void *indexData, D3DFORMAT indexDataFormat, const void *vertexStreamZeroData, unsigned int VertexStreamZeroStride) override;
+ long __stdcall ProcessVertices(unsigned int srcStartIndex, unsigned int destIndex, unsigned int vertexCount, IDirect3DVertexBuffer9 *destBuffer, IDirect3DVertexDeclaration9 *vertexDeclaration, unsigned long flags) override;
+ long __stdcall CreateVertexDeclaration(const D3DVERTEXELEMENT9 *vertexElements, IDirect3DVertexDeclaration9 **declaration) override;
+ long __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9 *declaration) override;
+ long __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9 **declaration) override;
+ long __stdcall SetFVF(unsigned long FVF) override;
+ long __stdcall GetFVF(unsigned long *FVF) override;
+ long __stdcall CreateVertexShader(const unsigned long *function, IDirect3DVertexShader9 **shader) override;
+ long __stdcall SetVertexShader(IDirect3DVertexShader9 *shader) override;
+ long __stdcall GetVertexShader(IDirect3DVertexShader9 **shader) override;
+ long __stdcall SetVertexShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count) override;
+ long __stdcall GetVertexShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count) override;
+ long __stdcall SetVertexShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall GetVertexShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall SetVertexShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall GetVertexShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall SetStreamSource(unsigned int stream, IDirect3DVertexBuffer9 *data, unsigned int offset, unsigned int stride) override;
+ long __stdcall GetStreamSource(unsigned int streamNumber, IDirect3DVertexBuffer9 **streamData, unsigned int *offset, unsigned int *stride) override;
+ long __stdcall SetStreamSourceFreq(unsigned int streamNumber, unsigned int divider) override;
+ long __stdcall GetStreamSourceFreq(unsigned int streamNumber, unsigned int *divider) override;
+ long __stdcall SetIndices(IDirect3DIndexBuffer9 *indexData) override;
+ long __stdcall GetIndices(IDirect3DIndexBuffer9 **indexData) override;
+ long __stdcall CreatePixelShader(const unsigned long *function, IDirect3DPixelShader9 **shader) override;
+ long __stdcall SetPixelShader(IDirect3DPixelShader9 *shader) override;
+ long __stdcall GetPixelShader(IDirect3DPixelShader9 **shader) override;
+ long __stdcall SetPixelShaderConstantI(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall GetPixelShaderConstantI(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall SetPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count) override;
+ long __stdcall GetPixelShaderConstantF(unsigned int startRegister, float *constantData, unsigned int count) override;
+ long __stdcall SetPixelShaderConstantB(unsigned int startRegister, const int *constantData, unsigned int count) override;
+ long __stdcall GetPixelShaderConstantB(unsigned int startRegister, int *constantData, unsigned int count) override;
+ long __stdcall DrawRectPatch(unsigned int handle, const float *numSegs, const D3DRECTPATCH_INFO *rectPatchInfo) override;
+ long __stdcall DrawTriPatch(unsigned int handle, const float *numSegs, const D3DTRIPATCH_INFO *triPatchInfo) override;
+ long __stdcall DeletePatch(unsigned int handle) override;
+ long __stdcall CreateQuery(D3DQUERYTYPE type, IDirect3DQuery9 **query) override;
+
// IDirect3DDevice9Ex methods
- long __stdcall SetConvolutionMonoKernel(UINT,UINT,float *,float *);
- long __stdcall ComposeRects(IDirect3DSurface9 *,IDirect3DSurface9 *,IDirect3DVertexBuffer9 *,UINT,IDirect3DVertexBuffer9 *,D3DCOMPOSERECTSOP,int,int);
- long __stdcall PresentEx(const RECT *,const RECT *,HWND,const RGNDATA *,DWORD);
- long __stdcall GetGPUThreadPriority(int *priority);
- long __stdcall SetGPUThreadPriority(int priority);
- long __stdcall WaitForVBlank(unsigned int swapChain);
- long __stdcall CheckResourceResidency(IDirect3DResource9 **resourceArray, unsigned int numResources);
- long __stdcall SetMaximumFrameLatency(unsigned int maxLatency);
- long __stdcall GetMaximumFrameLatency(unsigned int *maxLatency);
- long __stdcall CheckDeviceState(HWND destinationWindow);
- long __stdcall CreateRenderTargetEx(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long multiSampleQuality, int lockable, IDirect3DSurface9 **surface, void **sharedHandle, unsigned long usage);
- long __stdcall CreateOffscreenPlainSurfaceEx(unsigned int width, unsigned int height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, void **sharedHandle, unsigned long usage);
- long __stdcall CreateDepthStencilSurfaceEx(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long multiSampleQuality, int discard, IDirect3DSurface9 **surface, void **sharedHandle, unsigned long usage);
- long __stdcall ResetEx(D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode);
- long __stdcall GetDisplayModeEx(unsigned int swapChain, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation);
+ long __stdcall SetConvolutionMonoKernel(UINT,UINT,float *,float *) override;
+ long __stdcall ComposeRects(IDirect3DSurface9 *,IDirect3DSurface9 *,IDirect3DVertexBuffer9 *,UINT,IDirect3DVertexBuffer9 *,D3DCOMPOSERECTSOP,int,int) override;
+ long __stdcall PresentEx(const RECT *,const RECT *,HWND,const RGNDATA *,DWORD) override;
+ long __stdcall GetGPUThreadPriority(int *priority) override;
+ long __stdcall SetGPUThreadPriority(int priority) override;
+ long __stdcall WaitForVBlank(unsigned int swapChain) override;
+ long __stdcall CheckResourceResidency(IDirect3DResource9 **resourceArray, unsigned int numResources) override;
+ long __stdcall SetMaximumFrameLatency(unsigned int maxLatency) override;
+ long __stdcall GetMaximumFrameLatency(unsigned int *maxLatency) override;
+ long __stdcall CheckDeviceState(HWND destinationWindow) override;
+ long __stdcall CreateRenderTargetEx(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long multiSampleQuality, int lockable, IDirect3DSurface9 **surface, void **sharedHandle, unsigned long usage) override;
+ long __stdcall CreateOffscreenPlainSurfaceEx(unsigned int width, unsigned int height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, void **sharedHandle, unsigned long usage) override;
+ long __stdcall CreateDepthStencilSurfaceEx(unsigned int width, unsigned int height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long multiSampleQuality, int discard, IDirect3DSurface9 **surface, void **sharedHandle, unsigned long usage) override;
+ long __stdcall ResetEx(D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode) override;
+ long __stdcall GetDisplayModeEx(unsigned int swapChain, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation) override;
private:
Direct3D9Ex *const d3d9ex;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DIndexBuffer9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DIndexBuffer9.hpp
index 4f6e100b83c..b59e4a937c8 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DIndexBuffer9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DIndexBuffer9.hpp
@@ -31,28 +31,28 @@ namespace D3D9
public:
Direct3DIndexBuffer9(Direct3DDevice9 *device, unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DIndexBuffer9();
+ ~Direct3DIndexBuffer9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DIndexBuffer9 methods
- long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description);
- long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags);
- long __stdcall Unlock();
-
+ long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description) override;
+ long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags) override;
+ long __stdcall Unlock() override;
+
// Internal methods
sw::Resource *getResource() const;
bool is32Bit() const;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DPixelShader9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DPixelShader9.hpp
index 03c6cd88484..42ebf02e03c 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DPixelShader9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DPixelShader9.hpp
@@ -30,16 +30,16 @@ namespace D3D9
public:
Direct3DPixelShader9(Direct3DDevice9 *device, const unsigned long *shaderToken);
- virtual ~Direct3DPixelShader9();
+ ~Direct3DPixelShader9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DPixelShader9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall GetFunction(void *data, unsigned int *size);
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall GetFunction(void *data, unsigned int *size) override;
// Internal methods
const sw::PixelShader *getPixelShader() const;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DQuery9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DQuery9.hpp
index 775e40efd69..7c522f6044a 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DQuery9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DQuery9.hpp
@@ -30,19 +30,19 @@ namespace D3D9
public:
Direct3DQuery9(Direct3DDevice9 *device, D3DQUERYTYPE type);
- virtual ~Direct3DQuery9();
+ ~Direct3DQuery9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DQuery9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- D3DQUERYTYPE __stdcall GetType();
- unsigned long __stdcall GetDataSize();
- long __stdcall Issue(unsigned long flags);
- long __stdcall GetData(void *data, unsigned long size, unsigned long flags);
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ D3DQUERYTYPE __stdcall GetType() override;
+ unsigned long __stdcall GetDataSize() override;
+ long __stdcall Issue(unsigned long flags) override;
+ long __stdcall GetData(void *data, unsigned long size, unsigned long flags) override;
private:
// Creation parameters
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DResource9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DResource9.hpp
index 525f1a30434..e34fa1001f2 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DResource9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DResource9.hpp
@@ -30,22 +30,22 @@ namespace D3D9
public:
Direct3DResource9(Direct3DDevice9 *device, D3DRESOURCETYPE type, D3DPOOL pool, unsigned int size);
- virtual ~Direct3DResource9();
+ ~Direct3DResource9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- void __stdcall PreLoad();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ void __stdcall PreLoad() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// Internal methods
static unsigned int getMemoryUsage();
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DStateBlock9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DStateBlock9.hpp
index ed709b0a6d8..9f5977d5383 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DStateBlock9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DStateBlock9.hpp
@@ -37,17 +37,17 @@ namespace D3D9
public:
Direct3DStateBlock9(Direct3DDevice9 *device, D3DSTATEBLOCKTYPE type);
- virtual ~Direct3DStateBlock9();
+ ~Direct3DStateBlock9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DStateBlock9 methods
- long __stdcall Apply();
- long __stdcall Capture();
- long __stdcall GetDevice(IDirect3DDevice9 **device);
+ long __stdcall Apply() override;
+ long __stdcall Capture() override;
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
// Internal methods
void lightEnable(unsigned long index, int enable);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.cpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.cpp
index ef4d717ded8..fdbc0990d9c 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.cpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.cpp
@@ -85,6 +85,16 @@ namespace D3D9
{
}
+ void *Direct3DSurface9::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void Direct3DSurface9::unlockInternal()
+ {
+ Surface::unlockInternal();
+ }
+
long Direct3DSurface9::QueryInterface(const IID &iid, void **object)
{
CriticalSection cs(device);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.hpp
index f1f40d191b3..b7060d857ae 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DSurface9.hpp
@@ -30,30 +30,34 @@ namespace D3D9
public:
Direct3DSurface9(Direct3DDevice9 *device, Unknown *container, int width, int height, D3DFORMAT format, D3DPOOL pool, D3DMULTISAMPLE_TYPE multiSample, unsigned int quality, bool lockableOverride, unsigned long usage);
- virtual ~Direct3DSurface9();
+ ~Direct3DSurface9() override;
+
+ // Surface methods
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
+ void unlockInternal() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DSurface9 methods
- long __stdcall GetDC(HDC *deviceContext);
- long __stdcall ReleaseDC(HDC deviceContext);
- long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags);
- long __stdcall UnlockRect();
- long __stdcall GetContainer(const IID &iid, void **container);
- long __stdcall GetDesc(D3DSURFACE_DESC *desc);
+ long __stdcall GetDC(HDC *deviceContext) override;
+ long __stdcall ReleaseDC(HDC deviceContext) override;
+ long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags) override;
+ long __stdcall UnlockRect() override;
+ long __stdcall GetContainer(const IID &iid, void **container) override;
+ long __stdcall GetDesc(D3DSURFACE_DESC *desc) override;
// Internal methods
static sw::Format translateFormat(D3DFORMAT format);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DSwapChain9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DSwapChain9.hpp
index bdf64075ec0..dd26b3ec421 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DSwapChain9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DSwapChain9.hpp
@@ -32,21 +32,21 @@ namespace D3D9
public:
Direct3DSwapChain9(Direct3DDevice9 *device, D3DPRESENT_PARAMETERS *presentParameters);
- virtual ~Direct3DSwapChain9();
+ ~Direct3DSwapChain9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DSwapChain9 methods
- long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion, unsigned long flags);
- long __stdcall GetFrontBufferData(IDirect3DSurface9 *destSurface);
- long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer);
- long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus);
- long __stdcall GetDisplayMode(D3DDISPLAYMODE *displayMode);
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall GetPresentParameters(D3DPRESENT_PARAMETERS *presentParameters);
+ long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion, unsigned long flags) override;
+ long __stdcall GetFrontBufferData(IDirect3DSurface9 *destSurface) override;
+ long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer) override;
+ long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus) override;
+ long __stdcall GetDisplayMode(D3DDISPLAYMODE *displayMode) override;
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall GetPresentParameters(D3DPRESENT_PARAMETERS *presentParameters) override;
// Internal methods
void reset(D3DPRESENT_PARAMETERS *presentParameters);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DTexture9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DTexture9.hpp
index 506741efdd1..52bba538459 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DTexture9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DTexture9.hpp
@@ -27,40 +27,40 @@ namespace D3D9
class Direct3DTexture9 : public IDirect3DTexture9, public Direct3DBaseTexture9
{
- public:
+ public:
Direct3DTexture9(Direct3DDevice9 *device, unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DTexture9();
+ ~Direct3DTexture9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- void __stdcall PreLoad();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ void __stdcall PreLoad() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods
- unsigned long __stdcall SetLOD(unsigned long newLOD);
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall GetLevelCount();
- long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType);
- D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType();
- void __stdcall GenerateMipSubLevels();
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall GetLevelCount() override;
+ long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
+ D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
+ void __stdcall GenerateMipSubLevels() override;
// IDirect3DTexture9 methods
- long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description);
- long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface9 **surface);
- long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags);
- long __stdcall UnlockRect(unsigned int level);
- long __stdcall AddDirtyRect(const RECT *dirtyRect);
+ long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
+ long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface9 **surface) override;
+ long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
+ long __stdcall UnlockRect(unsigned int level) override;
+ long __stdcall AddDirtyRect(const RECT *dirtyRect) override;
// Internal methods
Direct3DSurface9 *getInternalSurfaceLevel(unsigned int level);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexBuffer9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexBuffer9.hpp
index d35c31eed23..7a0431fb871 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexBuffer9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexBuffer9.hpp
@@ -31,27 +31,27 @@ namespace D3D9
public:
Direct3DVertexBuffer9(Direct3DDevice9 *device, unsigned int length, unsigned long usage, long FVF, D3DPOOL pool);
- virtual ~Direct3DVertexBuffer9();
+ ~Direct3DVertexBuffer9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- void __stdcall PreLoad();
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ void __stdcall PreLoad() override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DVertexBuffer9 methods
- long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags);
- long __stdcall Unlock();
- long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description);
+ long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags) override;
+ long __stdcall Unlock() override;
+ long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description) override;
// Internal methods
int getLength() const;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexDeclaration9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexDeclaration9.hpp
index ab0621f7fc7..3aafd45adaf 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexDeclaration9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexDeclaration9.hpp
@@ -29,16 +29,16 @@ namespace D3D9
Direct3DVertexDeclaration9(Direct3DDevice9 *device, const D3DVERTEXELEMENT9 *vertexElements);
Direct3DVertexDeclaration9(Direct3DDevice9 *device, unsigned long FVF);
- virtual ~Direct3DVertexDeclaration9();
+ ~Direct3DVertexDeclaration9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DVertexDeclaration9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall GetDeclaration(D3DVERTEXELEMENT9 *declaration, unsigned int *numElements);
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall GetDeclaration(D3DVERTEXELEMENT9 *declaration, unsigned int *numElements) override;
// Internal methods
unsigned long getFVF() const;
@@ -50,7 +50,7 @@ namespace D3D9
// Creation parameters
Direct3DDevice9 *const device;
D3DVERTEXELEMENT9 *vertexElement;
-
+
int numElements;
unsigned long FVF;
bool preTransformed;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexShader9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexShader9.hpp
index fcd8eed5462..edc5fbdb3d9 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexShader9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DVertexShader9.hpp
@@ -30,16 +30,16 @@ namespace D3D9
public:
Direct3DVertexShader9(Direct3DDevice9 *device, const unsigned long *shaderToken);
- virtual ~Direct3DVertexShader9();
+ ~Direct3DVertexShader9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DVertexShader9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall GetFunction(void *data, unsigned int *size);
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall GetFunction(void *data, unsigned int *size) override;
// Internal methods
const sw::VertexShader *getVertexShader() const;
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.cpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.cpp
index fc67ecdbde4..4bf498bd7db 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.cpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.cpp
@@ -41,6 +41,16 @@ namespace D3D9
resource->unbind();
}
+ void *Direct3DVolume9::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void Direct3DVolume9::unlockInternal()
+ {
+ Surface::unlockInternal();
+ }
+
long __stdcall Direct3DVolume9::QueryInterface(const IID &iid, void **object)
{
CriticalSection cs(device);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.hpp
index eb6e166a348..0b3fedd20c7 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DVolume9.hpp
@@ -32,22 +32,26 @@ namespace D3D9
public:
Direct3DVolume9(Direct3DDevice9 *device, Direct3DVolumeTexture9 *container, int width, int height, int depth, D3DFORMAT format, D3DPOOL pool, unsigned long usage);
- virtual ~Direct3DVolume9();
+ ~Direct3DVolume9() override;
+
+ // Surface methods
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
+ void unlockInternal() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DVolume9 methods
- long __stdcall FreePrivateData(const GUID &guid);
- long __stdcall GetContainer(const IID &iid, void **container);
- long __stdcall GetDesc(D3DVOLUME_DESC *description);
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall UnlockBox();
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ long __stdcall GetContainer(const IID &iid, void **container) override;
+ long __stdcall GetDesc(D3DVOLUME_DESC *description) override;
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall UnlockBox() override;
private:
static sw::Format translateFormat(D3DFORMAT format);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Direct3DVolumeTexture9.hpp b/chromium/third_party/swiftshader/src/D3D9/Direct3DVolumeTexture9.hpp
index d90b63701f1..674e06f9e24 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Direct3DVolumeTexture9.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Direct3DVolumeTexture9.hpp
@@ -30,37 +30,37 @@ namespace D3D9
public:
Direct3DVolumeTexture9(Direct3DDevice9 *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
- virtual ~Direct3DVolumeTexture9();
+ ~Direct3DVolumeTexture9() override;
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// IDirect3DResource9 methods
- long __stdcall GetDevice(IDirect3DDevice9 **device);
- long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags);
- long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size);
- long __stdcall FreePrivateData(const GUID &guid);
- unsigned long __stdcall SetPriority(unsigned long newPriority);
- unsigned long __stdcall GetPriority();
- void __stdcall PreLoad();
- D3DRESOURCETYPE __stdcall GetType();
+ long __stdcall GetDevice(IDirect3DDevice9 **device) override;
+ long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
+ long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
+ long __stdcall FreePrivateData(const GUID &guid) override;
+ unsigned long __stdcall SetPriority(unsigned long newPriority) override;
+ unsigned long __stdcall GetPriority() override;
+ void __stdcall PreLoad() override;
+ D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods
- unsigned long __stdcall SetLOD(unsigned long newLOD);
- unsigned long __stdcall GetLOD();
- unsigned long __stdcall GetLevelCount();
- long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType);
- D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType();
- void __stdcall GenerateMipSubLevels();
+ unsigned long __stdcall SetLOD(unsigned long newLOD) override;
+ unsigned long __stdcall GetLOD() override;
+ unsigned long __stdcall GetLevelCount() override;
+ long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
+ D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
+ void __stdcall GenerateMipSubLevels() override;
// IDirect3DVolumeTexture9 methods
- long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description);
- long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume9 **volume);
- long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags);
- long __stdcall UnlockBox(unsigned int level);
- long __stdcall AddDirtyBox(const D3DBOX *dirtyBox);
+ long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description) override;
+ long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume9 **volume) override;
+ long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
+ long __stdcall UnlockBox(unsigned int level) override;
+ long __stdcall AddDirtyBox(const D3DBOX *dirtyBox) override;
// Internal methods
Direct3DVolume9 *getInternalVolumeLevel(unsigned int level);
diff --git a/chromium/third_party/swiftshader/src/D3D9/Unknown.hpp b/chromium/third_party/swiftshader/src/D3D9/Unknown.hpp
index 3064999e5fe..076f8811190 100644
--- a/chromium/third_party/swiftshader/src/D3D9/Unknown.hpp
+++ b/chromium/third_party/swiftshader/src/D3D9/Unknown.hpp
@@ -27,9 +27,9 @@ namespace D3D9
virtual ~Unknown();
// IUnknown methods
- long __stdcall QueryInterface(const IID &iid, void **object);
- unsigned long __stdcall AddRef();
- unsigned long __stdcall Release();
+ long __stdcall QueryInterface(const IID &iid, void **object) override;
+ unsigned long __stdcall AddRef() override;
+ unsigned long __stdcall Release() override;
// Internal methods
virtual void bind();
diff --git a/chromium/third_party/swiftshader/src/Main/Config.hpp b/chromium/third_party/swiftshader/src/Main/Config.hpp
index 9ea1e187602..7a754f3e4f7 100644
--- a/chromium/third_party/swiftshader/src/Main/Config.hpp
+++ b/chromium/third_party/swiftshader/src/Main/Config.hpp
@@ -79,7 +79,7 @@ namespace sw
enum
{
- OUTLINE_RESOLUTION = 4096, // Maximum vertical resolution of the render target
+ OUTLINE_RESOLUTION = 8192, // Maximum vertical resolution of the render target
MIPMAP_LEVELS = 14,
TEXTURE_IMAGE_UNITS = 16,
VERTEX_TEXTURE_IMAGE_UNITS = 16,
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBuffer.cpp b/chromium/third_party/swiftshader/src/Main/FrameBuffer.cpp
index ebfebede556..e95f7665b88 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBuffer.cpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBuffer.cpp
@@ -35,7 +35,6 @@ namespace sw
FrameBuffer::Cursor FrameBuffer::cursor = {};
bool FrameBuffer::topLeftOrigin = false;
- void FrameBuffer::typeinfo() {}
FrameBuffer::FrameBuffer(int width, int height, bool fullscreen, bool topLeftOrigin)
{
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBuffer.hpp b/chromium/third_party/swiftshader/src/Main/FrameBuffer.hpp
index 10ef6bc94d5..a18a0b12dc8 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBuffer.hpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBuffer.hpp
@@ -36,12 +36,10 @@ namespace sw
class [[clang::lto_visibility_public]] FrameBuffer
{
- virtual void typeinfo(); // Dummy key method (https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html)
-
public:
FrameBuffer(int width, int height, bool fullscreen, bool topLeftOrigin);
- virtual ~FrameBuffer();
+ virtual ~FrameBuffer() = 0;
int getWidth() const;
int getHeight() const;
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.cpp b/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.cpp
index e574d8285f2..73409216d03 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.cpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.cpp
@@ -13,6 +13,7 @@
// limitations under the License.
#include "FrameBufferAndroid.hpp"
+#include "GrallocAndroid.hpp"
#include <cutils/log.h>
@@ -47,12 +48,8 @@ namespace sw
FrameBufferAndroid::FrameBufferAndroid(ANativeWindow* window, int width, int height)
: FrameBuffer(width, height, false, false),
- nativeWindow(window), buffer(nullptr), gralloc(nullptr)
+ nativeWindow(window), buffer(nullptr)
{
- hw_module_t const* pModule;
- hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &pModule);
- gralloc = reinterpret_cast<gralloc_module_t const*>(pModule);
-
nativeWindow->common.incRef(&nativeWindow->common);
native_window_set_usage(nativeWindow, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
}
@@ -85,7 +82,7 @@ namespace sw
return nullptr;
}
- if(gralloc->lock(gralloc, buffer->handle,
+ if(GrallocModule::getInstance()->lock(buffer->handle,
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
0, 0, buffer->width, buffer->height, &locked) != 0)
{
@@ -127,7 +124,7 @@ namespace sw
locked = nullptr;
- if(gralloc->unlock(gralloc, buffer->handle) != 0)
+ if(GrallocModule::getInstance()->unlock(buffer->handle) != 0)
{
ALOGE("%s: badness unlock failed", __FUNCTION__);
}
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.hpp b/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.hpp
index 4995ecb3974..7e34ea27498 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.hpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferAndroid.hpp
@@ -28,7 +28,7 @@ namespace sw
public:
FrameBufferAndroid(ANativeWindow* window, int width, int height);
- ~FrameBufferAndroid();
+ ~FrameBufferAndroid() override;
void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
@@ -41,7 +41,6 @@ namespace sw
private:
ANativeWindow* nativeWindow;
ANativeWindowBuffer* buffer;
- gralloc_module_t const* gralloc;
};
}
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferDD.hpp b/chromium/third_party/swiftshader/src/Main/FrameBufferDD.hpp
index c2d160a1607..efe6d68600c 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferDD.hpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferDD.hpp
@@ -26,7 +26,7 @@ namespace sw
public:
FrameBufferDD(HWND windowHandle, int width, int height, bool fullscreen, bool topLeftOrigin);
- virtual ~FrameBufferDD();
+ ~FrameBufferDD() override;
void flip(void *source, Format sourceFormat, size_t sourceStride) override;
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferGDI.hpp b/chromium/third_party/swiftshader/src/Main/FrameBufferGDI.hpp
index f81cb8faf15..efe44a988a9 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferGDI.hpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferGDI.hpp
@@ -24,8 +24,8 @@ namespace sw
public:
FrameBufferGDI(HWND windowHandle, int width, int height, bool fullscreen, bool topLeftOrigin);
- virtual ~FrameBufferGDI();
-
+ ~FrameBufferGDI() override;
+
void flip(void *source, Format sourceFormat, size_t sourceStride) override;
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferWin.hpp b/chromium/third_party/swiftshader/src/Main/FrameBufferWin.hpp
index 2393658d76e..e3021953547 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferWin.hpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferWin.hpp
@@ -31,7 +31,7 @@ namespace sw
public:
FrameBufferWin(HWND windowHandle, int width, int height, bool fullscreen, bool topLeftOrigin);
- virtual ~FrameBufferWin();
+ ~FrameBufferWin() override;
void flip(void *source, Format sourceFormat, size_t sourceStride) override = 0;
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override = 0;
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferX11.cpp b/chromium/third_party/swiftshader/src/Main/FrameBufferX11.cpp
index 60e0e732278..12b83e4df52 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferX11.cpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferX11.cpp
@@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
-// such as the client area of a window, including any back buffers.
-// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
-
#include "FrameBufferX11.hpp"
#include "libX11.hpp"
diff --git a/chromium/third_party/swiftshader/src/Main/FrameBufferX11.hpp b/chromium/third_party/swiftshader/src/Main/FrameBufferX11.hpp
index a9c481bffdf..ab0c205d4dc 100644
--- a/chromium/third_party/swiftshader/src/Main/FrameBufferX11.hpp
+++ b/chromium/third_party/swiftshader/src/Main/FrameBufferX11.hpp
@@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
-// such as the client area of a window, including any back buffers.
-// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
-
#ifndef sw_FrameBufferX11_hpp
#define sw_FrameBufferX11_hpp
@@ -33,7 +29,7 @@ namespace sw
public:
FrameBufferX11(Display *display, Window window, int width, int height);
- ~FrameBufferX11();
+ ~FrameBufferX11() override;
void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/common/Image.cpp b/chromium/third_party/swiftshader/src/OpenGL/common/Image.cpp
index 02f7f0ff36e..d3fe20efecb 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/common/Image.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/common/Image.cpp
@@ -14,7 +14,7 @@
#include "Image.hpp"
-#include "Renderer/Blitter.hpp"
+#include "../libEGL/Context.hpp"
#include "../libEGL/Texture.hpp"
#include "../common/debug.h"
#include "Common/Math.hpp"
@@ -1178,11 +1178,64 @@ namespace egl
}
}
- void Image::typeinfo() {}
+ class ImageImplementation : public Image
+ {
+ public:
+ ImageImplementation(Texture *parentTexture, GLsizei width, GLsizei height, GLenum format, GLenum type)
+ : Image(parentTexture, width, height, format, type) {}
+ ImageImplementation(Texture *parentTexture, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type)
+ : Image(parentTexture, width, height, depth, format, type) {}
+ ImageImplementation(GLsizei width, GLsizei height, GLenum format, GLenum type, int pitchP)
+ : Image(width, height, format, type, pitchP) {}
+ ImageImplementation(GLsizei width, GLsizei height, sw::Format internalFormat, int multiSampleDepth, bool lockable)
+ : Image(width, height, internalFormat, multiSampleDepth, lockable) {}
+
+ ~ImageImplementation() override
+ {
+ sync(); // Wait for any threads that use this image to finish.
+ }
+
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override
+ {
+ return Image::lockInternal(x, y, z, lock, client);
+ }
+
+ void unlockInternal() override
+ {
+ return Image::unlockInternal();
+ }
+
+ void release() override
+ {
+ return Image::release();
+ }
+ };
+
+ Image *Image::create(Texture *parentTexture, GLsizei width, GLsizei height, GLenum format, GLenum type)
+ {
+ return new ImageImplementation(parentTexture, width, height, format, type);
+ }
+
+ Image *Image::create(Texture *parentTexture, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type)
+ {
+ return new ImageImplementation(parentTexture, width, height, depth, format, type);
+ }
+
+ Image *Image::create(GLsizei width, GLsizei height, GLenum format, GLenum type, int pitchP)
+ {
+ return new ImageImplementation(width, height, format, type, pitchP);
+ }
+
+ Image *Image::create(GLsizei width, GLsizei height, sw::Format internalFormat, int multiSampleDepth, bool lockable)
+ {
+ return new ImageImplementation(width, height, internalFormat, multiSampleDepth, lockable);
+ }
Image::~Image()
{
- sync(); // Wait for any threads that use this image to finish.
+ // sync() must be called in the destructor of the most derived class to ensure their vtable isn't destroyed
+ // before all threads are done using this image. Image itself is abstract so it can't be the most derived.
+ ASSERT(isUnlocked());
if(parentTexture)
{
@@ -1192,6 +1245,16 @@ namespace egl
ASSERT(!shared);
}
+ void *Image::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void Image::unlockInternal()
+ {
+ Surface::unlockInternal();
+ }
+
void Image::release()
{
int refs = dereference();
@@ -1224,18 +1287,19 @@ namespace egl
return parentTexture == parent;
}
- void Image::loadImageData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const UnpackInfo& unpackInfo, const void *input)
+ void Image::loadImageData(Context *context, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const UnpackInfo& unpackInfo, const void *input)
{
- GLsizei inputWidth = (unpackInfo.rowLength == 0) ? width : unpackInfo.rowLength;
- GLsizei inputPitch = ComputePitch(inputWidth, format, type, unpackInfo.alignment);
- GLsizei inputHeight = (unpackInfo.imageHeight == 0) ? height : unpackInfo.imageHeight;
- input = ((char*)input) + ComputePackingOffset(format, type, inputWidth, inputHeight, unpackInfo.alignment, unpackInfo.skipImages, unpackInfo.skipRows, unpackInfo.skipPixels);
sw::Format selectedInternalFormat = SelectInternalFormat(format, type);
if(selectedInternalFormat == sw::FORMAT_NULL)
{
return;
}
+ GLsizei inputWidth = (unpackInfo.rowLength == 0) ? width : unpackInfo.rowLength;
+ GLsizei inputPitch = ComputePitch(inputWidth, format, type, unpackInfo.alignment);
+ GLsizei inputHeight = (unpackInfo.imageHeight == 0) ? height : unpackInfo.imageHeight;
+ input = ((char*)input) + ComputePackingOffset(format, type, inputWidth, inputHeight, unpackInfo.alignment, unpackInfo.skipImages, unpackInfo.skipRows, unpackInfo.skipPixels);
+
if(selectedInternalFormat == internalFormat)
{
void *buffer = lock(0, 0, sw::LOCK_WRITEONLY);
@@ -1620,10 +1684,11 @@ namespace egl
}
else
{
- sw::Surface source(width, height, depth, ConvertFormatType(format, type), const_cast<void*>(input), inputPitch, inputPitch * inputHeight);
+ sw::Surface *source = sw::Surface::create(width, height, depth, ConvertFormatType(format, type), const_cast<void*>(input), inputPitch, inputPitch * inputHeight);
sw::Rect sourceRect(0, 0, width, height);
sw::Rect destRect(xoffset, yoffset, xoffset + width, yoffset + height);
- sw::blitter.blit(&source, sourceRect, this, destRect, false);
+ context->blit(source, sourceRect, this, destRect);
+ delete source;
}
}
diff --git a/chromium/third_party/swiftshader/src/OpenGL/common/Image.hpp b/chromium/third_party/swiftshader/src/OpenGL/common/Image.hpp
index 6cf0a5977d9..c2e7f534cb0 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/common/Image.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/common/Image.hpp
@@ -40,6 +40,8 @@
namespace egl
{
+class Context;
+
sw::Format ConvertFormatType(GLenum format, GLenum type);
sw::Format SelectInternalFormat(GLenum format, GLenum type);
GLsizei ComputePitch(GLsizei width, GLenum format, GLenum type, GLint alignment);
@@ -48,9 +50,7 @@ size_t ComputePackingOffset(GLenum format, GLenum type, GLsizei width, GLsizei h
class [[clang::lto_visibility_public]] Image : public sw::Surface, public gl::Object
{
- virtual void typeinfo(); // Dummy key method (https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html)
-
-public:
+protected:
// 2D texture image
Image(Texture *parentTexture, GLsizei width, GLsizei height, GLenum format, GLenum type)
: sw::Surface(parentTexture->getResource(), width, height, 1, SelectInternalFormat(format, type), true, true),
@@ -93,6 +93,19 @@ public:
Object::addRef();
}
+public:
+ // 2D texture image
+ static Image *create(Texture *parentTexture, GLsizei width, GLsizei height, GLenum format, GLenum type);
+
+ // 3D texture image
+ static Image *create(Texture *parentTexture, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type);
+
+ // Native EGL image
+ static Image *create(GLsizei width, GLsizei height, GLenum format, GLenum type, int pitchP);
+
+ // Render target
+ static Image *create(GLsizei width, GLsizei height, sw::Format internalFormat, int multiSampleDepth, bool lockable);
+
GLsizei getWidth() const
{
return width;
@@ -150,6 +163,9 @@ public:
unlockExternal();
}
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override = 0;
+ void unlockInternal() override = 0;
+
struct UnpackInfo
{
UnpackInfo() : alignment(4), rowLength(0), imageHeight(0), skipPixels(0), skipRows(0), skipImages(0) {}
@@ -162,10 +178,10 @@ public:
GLint skipImages;
};
- void loadImageData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const UnpackInfo& unpackInfo, const void *input);
+ void loadImageData(Context *context, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const UnpackInfo& unpackInfo, const void *input);
void loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels);
- void release() override;
+ void release() override = 0;
void unbind(const Texture *parent); // Break parent ownership and release
bool isChildOf(const Texture *parent) const;
@@ -188,7 +204,7 @@ protected:
egl::Texture *parentTexture;
- virtual ~Image();
+ ~Image() override = 0;
void loadD24S8ImageData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, int inputPitch, int inputHeight, const void *input, void *buffer);
void loadD32FS8ImageData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, int inputPitch, int inputHeight, const void *input, void *buffer);
@@ -252,14 +268,14 @@ public:
private:
ANativeWindowBuffer *nativeBuffer;
- virtual ~AndroidNativeImage()
+ ~AndroidNativeImage() override
{
sync(); // Wait for any threads that use this image to finish.
nativeBuffer->common.decRef(&nativeBuffer->common);
}
- virtual void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override
{
LOGLOCK("image=%p op=%s.swsurface lock=%d", this, __FUNCTION__, lock);
@@ -289,7 +305,7 @@ private:
return data;
}
- virtual void unlockInternal()
+ void unlockInternal() override
{
if(nativeBuffer) // Unlock the buffer from ANativeWindowBuffer
{
@@ -301,7 +317,7 @@ private:
sw::Surface::unlockInternal();
}
- virtual void *lock(unsigned int left, unsigned int top, sw::Lock lock)
+ void *lock(unsigned int left, unsigned int top, sw::Lock lock) override
{
LOGLOCK("image=%p op=%s lock=%d", this, __FUNCTION__, lock);
(void)sw::Surface::lockExternal(left, top, 0, lock, sw::PUBLIC);
@@ -309,7 +325,7 @@ private:
return lockNativeBuffer(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
}
- virtual void unlock()
+ void unlock() override
{
LOGLOCK("image=%p op=%s.ani", this, __FUNCTION__);
unlockNativeBuffer();
@@ -318,7 +334,7 @@ private:
sw::Surface::unlockExternal();
}
- void* lockNativeBuffer(int usage)
+ void *lockNativeBuffer(int usage)
{
void *buffer = nullptr;
GrallocModule::getInstance()->lock(nativeBuffer->handle, usage, 0, 0, nativeBuffer->width, nativeBuffer->height, &buffer);
@@ -330,6 +346,11 @@ private:
{
GrallocModule::getInstance()->unlock(nativeBuffer->handle);
}
+
+ void release() override
+ {
+ Image::release();
+ }
};
#endif // __ANDROID__
diff --git a/chromium/third_party/swiftshader/src/OpenGL/common/Object.cpp b/chromium/third_party/swiftshader/src/OpenGL/common/Object.cpp
index 1a4a7c843ac..b4d84c023dc 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/common/Object.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/common/Object.cpp
@@ -23,6 +23,7 @@
namespace gl
{
#ifndef NDEBUG
+sw::MutexLock Object::instances_mutex;
std::set<Object*> Object::instances;
#endif
@@ -31,6 +32,7 @@ Object::Object()
referenceCount = 0;
#ifndef NDEBUG
+ LockGuard instances_lock(instances_mutex);
instances.insert(this);
#endif
}
@@ -40,6 +42,7 @@ Object::~Object()
ASSERT(referenceCount == 0);
#ifndef NDEBUG
+ LockGuard instances_lock(instances_mutex);
ASSERT(instances.find(this) != instances.end()); // Check for double deletion
instances.erase(this);
#endif
@@ -89,6 +92,7 @@ struct ObjectLeakCheck
{
~ObjectLeakCheck()
{
+ LockGuard instances_lock(Object::instances_mutex);
ASSERT(Object::instances.empty()); // Check for GL object leak at termination
}
};
diff --git a/chromium/third_party/swiftshader/src/OpenGL/common/Object.hpp b/chromium/third_party/swiftshader/src/OpenGL/common/Object.hpp
index c6243ac4076..7d9a8fef4dc 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/common/Object.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/common/Object.hpp
@@ -20,6 +20,7 @@
#define gl_Object_hpp
#include "common/debug.h"
+#include "Common/MutexLock.hpp"
#include <set>
@@ -51,6 +52,7 @@ protected:
#ifndef NDEBUG
public:
+ static sw::MutexLock instances_mutex;
static std::set<Object*> instances; // For leak checking
#endif
};
diff --git a/chromium/third_party/swiftshader/src/OpenGL/common/Surface.hpp b/chromium/third_party/swiftshader/src/OpenGL/common/Surface.hpp
new file mode 100644
index 00000000000..50a9d004aae
--- /dev/null
+++ b/chromium/third_party/swiftshader/src/OpenGL/common/Surface.hpp
@@ -0,0 +1,52 @@
+// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Surface.hpp: Defines the gl::Surface class, which is the abstract interface
+// for an EGL surface as viewed by the GL implementation.
+
+#ifndef INCLUDE_SURFACE_H_
+#define INCLUDE_SURFACE_H_
+
+#include "Renderer/Surface.hpp"
+
+#include <EGL/egl.h>
+
+namespace egl
+{
+class Texture;
+class Image;
+}
+
+namespace gl
+{
+class [[clang::lto_visibility_public]] Surface
+{
+protected:
+ Surface();
+ virtual ~Surface() = 0;
+
+public:
+ virtual egl::Image *getRenderTarget() = 0;
+ virtual egl::Image *getDepthStencil() = 0;
+
+ virtual sw::Format getInternalFormat() const = 0;
+
+ virtual EGLint getWidth() const = 0;
+ virtual EGLint getHeight() const = 0;
+
+ virtual void setBoundTexture(egl::Texture *texture) = 0;
+};
+}
+
+#endif // INCLUDE_SURFACE_H_
diff --git a/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.cpp b/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.cpp
index 60991af7718..48f00179c1e 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.cpp
@@ -14,6 +14,23 @@
#include "AnalyzeCallDepth.h"
+static TIntermSequence::iterator
+traverseCaseBody(AnalyzeCallDepth* analysis,
+ TIntermSequence::iterator& start,
+ const TIntermSequence::iterator& end) {
+ TIntermSequence::iterator current = start;
+ for (++current; current != end; ++current)
+ {
+ (*current)->traverse(analysis);
+ if((*current)->getAsBranchNode()) // Kill, Break, Continue or Return
+ {
+ break;
+ }
+ }
+ return current;
+}
+
+
AnalyzeCallDepth::FunctionNode::FunctionNode(TIntermAggregate *node) : node(node)
{
visit = PreVisit;
@@ -101,6 +118,50 @@ AnalyzeCallDepth::~AnalyzeCallDepth()
}
}
+bool AnalyzeCallDepth::visitSwitch(Visit visit, TIntermSwitch *node)
+{
+ TIntermTyped* switchValue = node->getInit();
+ TIntermAggregate* opList = node->getStatementList();
+
+ if(!switchValue || !opList)
+ {
+ return false;
+ }
+
+ // TODO: We need to dig into switch statement cases from
+ // visitSwitch for all traversers. Is there a way to
+ // preserve existing functionality while moving the iteration
+ // to the general traverser?
+ TIntermSequence& sequence = opList->getSequence();
+ TIntermSequence::iterator it = sequence.begin();
+ TIntermSequence::iterator defaultIt = sequence.end();
+ for(; it != sequence.end(); ++it)
+ {
+ TIntermCase* currentCase = (*it)->getAsCaseNode();
+ if(currentCase)
+ {
+ TIntermSequence::iterator caseIt = it;
+ TIntermTyped* condition = currentCase->getCondition();
+ if(condition) // non default case
+ {
+ condition->traverse(this);
+ traverseCaseBody(this, caseIt, sequence.end());
+ }
+ else
+ {
+ defaultIt = it; // The default case might not be the last case, keep it for last
+ }
+ }
+ }
+
+ // If there's a default case, traverse it here
+ if(defaultIt != sequence.end())
+ {
+ traverseCaseBody(this, defaultIt, sequence.end());
+ }
+ return false;
+}
+
bool AnalyzeCallDepth::visitAggregate(Visit visit, TIntermAggregate *node)
{
switch(node->getOp())
diff --git a/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.h b/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.h
index b2ca07adb6e..76d6522999e 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/compiler/AnalyzeCallDepth.h
@@ -27,6 +27,7 @@ public:
AnalyzeCallDepth(TIntermNode *root);
~AnalyzeCallDepth();
+ virtual bool visitSwitch(Visit, TIntermSwitch*);
virtual bool visitAggregate(Visit, TIntermAggregate*);
unsigned int analyzeCallDepth();
diff --git a/chromium/third_party/swiftshader/src/OpenGL/compiler/SymbolTable.cpp b/chromium/third_party/swiftshader/src/OpenGL/compiler/SymbolTable.cpp
index 89ad4d13d0a..95bd710100a 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/compiler/SymbolTable.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/compiler/SymbolTable.cpp
@@ -27,7 +27,7 @@
#include <limits.h>
#include <algorithm>
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && MSC_VER < 1900
#define snprintf _snprintf
#endif
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Android.mk b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Android.mk
index d756685288f..8026c7b9ee7 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Android.mk
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Android.mk
@@ -19,7 +19,7 @@ endif
COMMON_SRC_FILES := \
Config.cpp \
Display.cpp \
- EGLSurface.cpp \
+ Surface.cpp \
libEGL.cpp \
main.cpp
@@ -35,6 +35,12 @@ COMMON_SHARED_LIBRARIES := \
libcutils \
libhardware
+# gralloc1 is introduced from N MR1
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1)
+COMMON_CFLAGS += -DHAVE_GRALLOC1
+COMMON_SHARED_LIBRARIES += libsync
+endif
+
# Marshmallow does not have stlport, but comes with libc++ by default
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
COMMON_SHARED_LIBRARIES += libstlport
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn b/chromium/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn
index 62860703b9b..0ce3a8fd0e0 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import("//build/toolchain/toolchain.gni")
-
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_libEGL_private_config") {
defines = [ "EGL_EGLEXT_PROTOTYPES" ]
@@ -35,13 +33,10 @@ config("swiftshader_libEGL_private_config") {
cflags += [ "-Wno-unused-but-set-variable" ]
}
- defines += [ "LOG_TAG=\"swiftshader_libEGL\"" ]
-
- if (is_linux) {
- defines += [ "EGLAPI=__attribute__((visibility(\"protected\")))" ]
- } else {
- defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
- }
+ defines += [
+ "LOG_TAG=\"swiftshader_libEGL\"",
+ "EGLAPI=__attribute__((visibility(\"default\")))",
+ ]
}
}
@@ -51,11 +46,15 @@ shared_library("swiftshader_libEGL") {
output_dir = "$root_out_dir/swiftshader"
}
+ deps = [
+ "//build/config:exe_and_shlib_deps",
+ ]
+
sources = [
"../common/Object.cpp",
"Config.cpp",
"Display.cpp",
- "EGLSurface.cpp",
+ "Surface.cpp",
"libEGL.cpp",
"libEGL.def",
"libEGL.rc",
@@ -73,30 +72,16 @@ shared_library("swiftshader_libEGL") {
"Quartz.framework",
"Cocoa.framework",
]
+ ldflags = [ "-Wl,-install_name,@rpath/libswiftshader_libEGL.dylib" ]
} else if (is_win) {
configs -= [ "//build/config/win:unicode" ]
ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
} else if (is_linux) {
- sources += [
- "../../Main/libX11.cpp",
- "TypeInfo.cpp",
- ]
+ sources += [ "../../Main/libX11.cpp" ]
ldflags =
[ "-Wl,--version-script=" + rebase_path("exports.map", root_build_dir) ]
}
- if (use_thin_lto) {
- # https://crbug.com/686980
- # This target relies on the linker to be smart and garbage collect unused symbols.
- # It is not the case for LLD + ThinLTO, so we have to use this ugly workaround.
- cflags = [
- "-Xclang",
- "-fno-lto-unit",
- "-fno-whole-program-vtables",
- "-fno-sanitize=cfi",
- ]
- }
-
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Context.hpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Context.hpp
index 70a47a61a54..4768716c5d6 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Context.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Context.hpp
@@ -16,30 +16,34 @@
#define egl_Context_hpp
#include "common/Object.hpp"
+#include "Renderer/Surface.hpp"
#include <EGL/egl.h>
#include <GLES/gl.h>
+namespace gl { class Surface; }
+
namespace egl
{
class Display;
-class Surface;
class Image;
class [[clang::lto_visibility_public]] Context : public gl::Object
{
public:
- Context(egl::Display *display) : display(display) {}
-
- virtual void makeCurrent(Surface *surface) = 0;
- virtual void bindTexImage(Surface *surface) = 0;
+ virtual void makeCurrent(gl::Surface *surface) = 0;
+ virtual void bindTexImage(gl::Surface *surface) = 0;
virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0;
virtual Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0;
virtual EGLint getClientVersion() const = 0;
virtual EGLint getConfigID() const = 0;
virtual void finish() = 0;
+ virtual void blit(sw::Surface *source, const sw::SliceRect &sRect, sw::Surface *dest, const sw::SliceRect &dRect) = 0;
+
+ Display *getDisplay() const { return display; }
protected:
+ Context(egl::Display *display) : display(display) {}
virtual ~Context() {};
egl::Display *const display;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.cpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.cpp
index b5097acd112..b08fa6567bc 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.cpp
@@ -19,7 +19,7 @@
#include "Display.h"
#include "main.h"
-#include "libEGL/EGLSurface.h"
+#include "libEGL/Surface.hpp"
#include "libEGL/Context.hpp"
#include "common/Image.hpp"
#include "common/debug.h"
@@ -42,7 +42,18 @@
namespace egl
{
-void Display::typeinfo() {}
+
+class DisplayImplementation : public Display
+{
+public:
+ DisplayImplementation(EGLDisplay dpy, void *nativeDisplay) : Display(dpy, nativeDisplay) {}
+ ~DisplayImplementation() override {}
+
+ Image *getSharedImage(EGLImageKHR name) override
+ {
+ return Display::getSharedImage(name);
+ }
+};
Display *Display::get(EGLDisplay dpy)
{
@@ -61,12 +72,12 @@ Display *Display::get(EGLDisplay dpy)
}
#endif
- static Display display(nativeDisplay);
+ static DisplayImplementation display(dpy, nativeDisplay);
return &display;
}
-Display::Display(void *nativeDisplay) : nativeDisplay(nativeDisplay)
+Display::Display(EGLDisplay eglDisplay, void *nativeDisplay) : eglDisplay(eglDisplay), nativeDisplay(nativeDisplay)
{
mMinSwapInterval = 1;
mMaxSwapInterval = 1;
@@ -599,6 +610,11 @@ EGLint Display::getMaxSwapInterval() const
return mMaxSwapInterval;
}
+EGLDisplay Display::getEGLDisplay() const
+{
+ return eglDisplay;
+}
+
void *Display::getNativeDisplay() const
{
return nativeDisplay;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.h b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.h
index 3fba9e77baf..5944d69d5fc 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Display.h
@@ -37,7 +37,9 @@ namespace egl
class [[clang::lto_visibility_public]] Display
{
- virtual void typeinfo(); // Dummy key method (https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html)
+ protected:
+ explicit Display(EGLDisplay eglDisplay, void *nativeDisplay);
+ virtual ~Display() = 0;
public:
static Display *get(EGLDisplay dpy);
@@ -68,18 +70,17 @@ namespace egl
EGLint getMinSwapInterval() const;
EGLint getMaxSwapInterval() const;
+ EGLDisplay getEGLDisplay() const;
void *getNativeDisplay() const;
EGLImageKHR createSharedImage(Image *image);
bool destroySharedImage(EGLImageKHR);
- virtual Image *getSharedImage(EGLImageKHR name);
+ virtual Image *getSharedImage(EGLImageKHR name) = 0;
private:
- explicit Display(void *nativeDisplay);
- ~Display();
-
sw::Format getDisplayFormat() const;
+ const EGLDisplay eglDisplay;
void *const nativeDisplay;
EGLint mMaxSwapInterval;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.cpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Surface.cpp
index 1939431eadf..8cb3b3952c0 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Surface.cpp
@@ -16,7 +16,7 @@
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
-#include "EGLSurface.h"
+#include "Surface.hpp"
#include "main.h"
#include "Display.h"
@@ -36,10 +36,19 @@
#include <algorithm>
-namespace egl
+namespace gl
+{
+Surface::Surface()
+{
+}
+
+Surface::~Surface()
{
-void Surface::typeinfo() {}
+}
+}
+namespace egl
+{
Surface::Surface(const Display *display, const Config *config) : display(display), config(config)
{
backBuffer = nullptr;
@@ -69,11 +78,11 @@ bool Surface::initialize()
if(libGLES_CM)
{
- backBuffer = libGLES_CM->createBackBuffer(width, height, config);
+ backBuffer = libGLES_CM->createBackBuffer(width, height, config->mRenderTargetFormat, config->mSamples);
}
else if(libGLESv2)
{
- backBuffer = libGLESv2->createBackBuffer(width, height, config);
+ backBuffer = libGLESv2->createBackBuffer(width, height, config->mRenderTargetFormat, config->mSamples);
}
if(!backBuffer)
@@ -87,11 +96,11 @@ bool Surface::initialize()
{
if(libGLES_CM)
{
- depthStencil = libGLES_CM->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples, false);
+ depthStencil = libGLES_CM->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples);
}
else if(libGLESv2)
{
- depthStencil = libGLESv2->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples, false);
+ depthStencil = libGLESv2->createDepthStencil(width, height, config->mDepthStencilFormat, config->mSamples);
}
if(!depthStencil)
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.h b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Surface.hpp
index 3ebc2e4b0d7..e140a8e0c77 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/Surface.hpp
@@ -12,15 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Surface.h: Defines the egl::Surface class, representing a drawing surface
+// Surface.hpp: Defines the egl::Surface class, representing a rendering surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
-#ifndef INCLUDE_SURFACE_H_
-#define INCLUDE_SURFACE_H_
+#ifndef INCLUDE_EGL_SURFACE_H_
+#define INCLUDE_EGL_SURFACE_H_
-#include "Main/FrameBuffer.hpp"
#include "common/Object.hpp"
+#include "common/Surface.hpp"
+
+#include "Main/FrameBuffer.hpp"
#include <EGL/egl.h>
@@ -28,29 +30,25 @@ namespace egl
{
class Display;
class Config;
-class Texture;
-class Image;
-class [[clang::lto_visibility_public]] Surface : public gl::Object
+class Surface : public gl::Surface, public gl::Object
{
- virtual void typeinfo(); // Dummy key method (https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html)
-
public:
virtual bool initialize();
virtual void swap() = 0;
- virtual egl::Image *getRenderTarget();
- virtual egl::Image *getDepthStencil();
+ egl::Image *getRenderTarget() override;
+ egl::Image *getDepthStencil() override;
void setSwapBehavior(EGLenum swapBehavior);
void setSwapInterval(EGLint interval);
virtual EGLint getConfigID() const;
virtual EGLenum getSurfaceType() const;
- virtual sw::Format getInternalFormat() const;
+ sw::Format getInternalFormat() const override;
- virtual EGLint getWidth() const;
- virtual EGLint getHeight() const;
+ EGLint getWidth() const override;
+ EGLint getHeight() const override;
virtual EGLint getPixelAspectRatio() const;
virtual EGLenum getRenderBuffer() const;
virtual EGLenum getSwapBehavior() const;
@@ -59,7 +57,7 @@ public:
virtual EGLBoolean getLargestPBuffer() const;
virtual EGLNativeWindowType getWindowHandle() const = 0;
- virtual void setBoundTexture(egl::Texture *texture);
+ void setBoundTexture(egl::Texture *texture) override;
virtual egl::Texture *getBoundTexture() const;
virtual bool isWindowSurface() const { return false; }
@@ -68,7 +66,7 @@ public:
protected:
Surface(const Display *display, const Config *config);
- virtual ~Surface();
+ ~Surface() override;
virtual void deleteResources();
@@ -136,4 +134,4 @@ private:
};
}
-#endif // INCLUDE_SURFACE_H_
+#endif // INCLUDE_EGL_SURFACE_H_
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/TypeInfo.cpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/TypeInfo.cpp
deleted file mode 100644
index 0b4b97e28e9..00000000000
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/TypeInfo.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2017 The SwiftShader Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "common/Image.hpp"
-#include "Main/FrameBuffer.hpp"
-#include "Renderer/Surface.hpp"
-
-namespace sw
-{
-void FrameBuffer::typeinfo() {}
-void Surface::typeinfo() {}
-}
-
-namespace egl
-{
-void Image::typeinfo() {}
-}
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/exports.map b/chromium/third_party/swiftshader/src/OpenGL/libEGL/exports.map
index 487457ed7c3..8455dc9121b 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/exports.map
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/exports.map
@@ -1,5 +1,6 @@
{
global:
+ # EGL core functions
eglBindAPI;
eglBindTexImage;
eglChooseConfig;
@@ -46,9 +47,13 @@ global:
eglClientWaitSyncKHR;
eglGetSyncAttribKHR;
+ # Table of function pointers to disambiguate between libraries
libEGL_swiftshader;
+ # Type-strings and type-infos required by sanitizers
+ _ZTS*;
+ _ZTI*;
+
local:
- *;
+ *;
};
-
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp
index 057bc04ba3f..3a62da03d76 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp
@@ -16,7 +16,7 @@
#include "main.h"
#include "Display.h"
-#include "EGLSurface.h"
+#include "Surface.hpp"
#include "Texture.hpp"
#include "Context.hpp"
#include "common/Image.hpp"
@@ -171,15 +171,16 @@ const char *QueryString(EGLDisplay dpy, EGLint name)
{
TRACE("(EGLDisplay dpy = %p, EGLint name = %d)", dpy, name);
- #if defined(__linux__) && !defined(__ANDROID__)
- if(dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS)
- {
- return success("EGL_KHR_platform_gbm "
- "EGL_KHR_platform_x11 "
- "EGL_EXT_client_extensions "
- "EGL_EXT_platform_base");
- }
- #endif
+ if(dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS)
+ {
+ return success(
+#if defined(__linux__) && !defined(__ANDROID__)
+ "EGL_KHR_platform_gbm "
+ "EGL_KHR_platform_x11 "
+#endif
+ "EGL_EXT_client_extensions "
+ "EGL_EXT_platform_base");
+ }
egl::Display *display = egl::Display::get(dpy);
@@ -809,7 +810,6 @@ EGLBoolean MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLCont
UNIMPLEMENTED(); // FIXME
}
- egl::setCurrentDisplay(dpy);
egl::setCurrentDrawSurface(drawSurface);
egl::setCurrentReadSurface(readSurface);
egl::setCurrentContext(context);
@@ -855,7 +855,21 @@ EGLDisplay GetCurrentDisplay(void)
{
TRACE("()");
- return success(egl::getCurrentDisplay());
+ egl::Context *context = egl::getCurrentContext();
+
+ if(!context)
+ {
+ return success(EGL_NO_DISPLAY);
+ }
+
+ egl::Display *display = context->getDisplay();
+
+ if(!display)
+ {
+ return error(EGL_BAD_ACCESS, EGL_NO_DISPLAY);
+ }
+
+ return success(display->getEGLDisplay());
}
EGLBoolean QueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp
index 719117bd154..683b0d19784 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp
@@ -114,9 +114,9 @@ private:
#endif
#elif defined(__APPLE__)
#if defined(__LP64__)
- const char *libEGL_lib[] = {"lib64EGL_translator.dylib", "libEGL.so", "libEGL.dylib"};
+ const char *libEGL_lib[] = {"lib64EGL_translator.dylib", "libEGL.so", "libEGL.dylib", "libswiftshader_libEGL.dylib"};
#else
- const char *libEGL_lib[] = {"libEGL_translator.dylib", "libEGL.so", "libEGL.dylib"};
+ const char *libEGL_lib[] = {"libEGL_translator.dylib", "libEGL.so", "libEGL.dylib", "libswiftshader_libEGL.dylib"};
#endif
#else
#error "libEGL::loadExports unimplemented for this platform"
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj
index 9262ef8c963..a13b58f9e32 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj
@@ -319,13 +319,14 @@ copy "$(OutDir)libEGL.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\trans
<ClCompile Include="Display.cpp" />
<ClCompile Include="libEGL.cpp" />
<ClCompile Include="main.cpp" />
- <ClCompile Include="EGLSurface.cpp" />
+ <ClCompile Include="Surface.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\debug.h" />
<ClInclude Include="..\common\Image.hpp" />
<ClInclude Include="..\common\NameSpace.hpp" />
<ClInclude Include="..\common\Object.hpp" />
+ <ClInclude Include="..\common\Surface.hpp" />
<ClInclude Include="..\include\EGL\egl.h" />
<ClInclude Include="..\include\EGL\eglext.h" />
<ClInclude Include="..\include\EGL\eglplatform.h" />
@@ -335,7 +336,7 @@ copy "$(OutDir)libEGL.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\trans
<ClInclude Include="libEGL.hpp" />
<ClInclude Include="main.h" />
<ClInclude Include="resource.h" />
- <ClInclude Include="EGLSurface.h" />
+ <ClInclude Include="Surface.hpp" />
<ClInclude Include="Sync.hpp" />
<ClInclude Include="Texture.hpp" />
</ItemGroup>
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj.filters b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj.filters
index 26991845565..199b05a32e3 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj.filters
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/libEGL.vcxproj.filters
@@ -29,7 +29,7 @@
<ClCompile Include="..\common\Object.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="EGLSurface.cpp">
+ <ClCompile Include="Surface.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@@ -79,7 +79,10 @@
<ClInclude Include="..\common\NameSpace.hpp">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="EGLSurface.h">
+ <ClInclude Include="..\common\Surface.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Surface.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.cpp b/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.cpp
index 77ec2482158..7f024d00767 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.cpp
@@ -18,7 +18,7 @@
#include "libEGL.hpp"
#include "Context.hpp"
-#include "EGLSurface.h"
+#include "Surface.hpp"
#include "resource.h"
#include "Common/Thread.hpp"
@@ -39,23 +39,31 @@ static sw::Thread::LocalStorageKey currentTLS = TLS_OUT_OF_INDEXES;
namespace egl
{
-void attachThread()
+Current *attachThread()
{
TRACE("()");
- Current *current = new Current;
+ if(currentTLS == TLS_OUT_OF_INDEXES)
+ {
+ currentTLS = sw::Thread::allocateLocalStorageKey();
+ }
- if(current)
+ Current *current = (Current*)sw::Thread::getLocalStorage(currentTLS);
+
+ if(!current)
{
- sw::Thread::setLocalStorage(currentTLS, current);
+ current = new Current;
- current->error = EGL_SUCCESS;
- current->API = EGL_OPENGL_ES_API;
- current->display = EGL_NO_DISPLAY;
- current->context = nullptr;
- current->drawSurface = nullptr;
- current->readSurface = nullptr;
+ sw::Thread::setLocalStorage(currentTLS, current);
}
+
+ current->error = EGL_SUCCESS;
+ current->API = EGL_OPENGL_ES_API;
+ current->context = nullptr;
+ current->drawSurface = nullptr;
+ current->readSurface = nullptr;
+
+ return current;
}
void detachThread()
@@ -83,13 +91,6 @@ CONSTRUCTOR void attachProcess()
}
#endif
- currentTLS = sw::Thread::allocateLocalStorageKey();
-
- if(currentTLS == TLS_OUT_OF_INDEXES)
- {
- return;
- }
-
attachThread();
}
@@ -177,10 +178,10 @@ static Current *getCurrent(void)
if(!current)
{
- attachThread();
+ current = attachThread();
}
- return (Current*)sw::Thread::getLocalStorage(currentTLS);
+ return current;
}
void setCurrentError(EGLint error)
@@ -211,20 +212,6 @@ EGLenum getCurrentAPI()
return current->API;
}
-void setCurrentDisplay(EGLDisplay dpy)
-{
- Current *current = getCurrent();
-
- current->display = dpy;
-}
-
-EGLDisplay getCurrentDisplay()
-{
- Current *current = getCurrent();
-
- return current->display;
-}
-
void setCurrentContext(egl::Context *ctx)
{
Current *current = getCurrent();
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.h b/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.h
index f3231f0bf38..a2a8f440c33 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libEGL/main.h
@@ -28,12 +28,13 @@ namespace egl
class Display;
class Context;
class Surface;
+ class Config;
+ class Image;
struct Current
{
EGLint error;
EGLenum API;
- EGLDisplay display;
Context *context;
Surface *drawSurface;
Surface *readSurface;
@@ -47,9 +48,6 @@ namespace egl
void setCurrentAPI(EGLenum API);
EGLenum getCurrentAPI();
- void setCurrentDisplay(EGLDisplay dpy);
- EGLDisplay getCurrentDisplay();
-
void setCurrentContext(Context *ctx);
Context *getCurrentContext();
@@ -76,12 +74,6 @@ namespace egl
return returnValue;
}
-
- class Config;
- class Surface;
- class Display;
- class Context;
- class Image;
}
extern LibGLES_CM libGLES_CM;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.cpp
index 6a8c01dc881..8126de2842a 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.cpp
@@ -71,6 +71,16 @@ namespace gl
unlockExternal();
}
+ void *Image::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void Image::unlockInternal()
+ {
+ Surface::unlockInternal();
+ }
+
int Image::getWidth()
{
return width;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.hpp b/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.hpp
index 9192c8ee831..2b74cf3bb3e 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGL/Image.hpp
@@ -39,6 +39,9 @@ namespace gl
unsigned int getPitch() const;
void unlock();
+ void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
+ void unlockInternal() override;
+
int getWidth();
int getHeight();
GLenum getFormat();
@@ -53,7 +56,7 @@ namespace gl
static sw::Format selectInternalFormat(GLenum format, GLenum type);
private:
- virtual ~Image();
+ ~Image() override;
void loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, int inputPitch, const void *input, void *buffer) const;
void loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, int inputPitch, const void *input, void *buffer) const;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Android.mk b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Android.mk
index 582f35f8942..25cef87cd1d 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Android.mk
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Android.mk
@@ -58,6 +58,12 @@ COMMON_SHARED_LIBRARIES := \
libcutils \
libhardware
+# gralloc1 is introduced from N MR1
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1)
+COMMON_CFLAGS += -DHAVE_GRALLOC1
+COMMON_SHARED_LIBRARIES += libsync
+endif
+
# Marshmallow does not have stlport, but comes with libc++ by default
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
COMMON_SHARED_LIBRARIES += libstlport
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.cpp
index 78fcec519b5..b6f76c83754 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.cpp
@@ -28,7 +28,7 @@
#include "VertexDataManager.h"
#include "IndexDataManager.h"
#include "libEGL/Display.h"
-#include "libEGL/EGLSurface.h"
+#include "common/Surface.hpp"
#include "Common/Half.hpp"
#include <EGL/eglext.h>
@@ -281,7 +281,7 @@ Context::~Context()
delete device;
}
-void Context::makeCurrent(egl::Surface *surface)
+void Context::makeCurrent(gl::Surface *surface)
{
if(!mHasBeenCurrent)
{
@@ -2850,6 +2850,11 @@ void Context::drawTexture(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloa
projectionStack.load(P);
}
+void Context::blit(sw::Surface *source, const sw::SliceRect &sRect, sw::Surface *dest, const sw::SliceRect &dRect)
+{
+ device->blit(source, sRect, dest, dRect, false);
+}
+
void Context::finish()
{
device->finish();
@@ -3095,7 +3100,7 @@ void Context::setVertexAttrib(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLf
mVertexDataManager->dirtyCurrentValue(index);
}
-void Context::bindTexImage(egl::Surface *surface)
+void Context::bindTexImage(gl::Surface *surface)
{
es1::Texture2D *textureObject = getTexture2D();
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.h b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.h
index 63efb7420e4..ece28606f9c 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Context.h
@@ -33,10 +33,11 @@
#include <map>
#include <string>
+namespace gl { class Surface; }
+
namespace egl
{
class Display;
-class Surface;
class Config;
}
@@ -296,7 +297,7 @@ class [[clang::lto_visibility_public]] Context : public egl::Context
public:
Context(egl::Display *display, const Context *shareContext, const egl::Config *config);
- void makeCurrent(egl::Surface *surface) override;
+ void makeCurrent(gl::Surface *surface) override;
EGLint getClientVersion() const override;
EGLint getConfigID() const override;
@@ -489,11 +490,12 @@ public:
bool isQueryParameterBool(GLenum pname);
bool isQueryParameterPointer(GLenum pname);
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei *bufSize, void* pixels);
- void clear(GLbitfield mask);
void drawArrays(GLenum mode, GLint first, GLsizei count);
void drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices);
void drawTexture(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+ void blit(sw::Surface *source, const sw::SliceRect &sRect, sw::Surface *dest, const sw::SliceRect &dRect) override;
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei *bufSize, void* pixels);
+ void clear(GLbitfield mask);
void flush();
void recordInvalidEnum();
@@ -508,9 +510,9 @@ public:
static int getSupportedMultisampleCount(int requested);
- virtual void bindTexImage(egl::Surface *surface);
- virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel);
- virtual egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel);
+ void bindTexImage(gl::Surface *surface) override;
+ EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
+ egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
egl::Image *getSharedImage(GLeglImageOES image);
Device *getDevice();
@@ -579,7 +581,7 @@ public:
void setPointFadeThresholdSize(float threshold);
private:
- virtual ~Context();
+ ~Context() override;
bool applyRenderTarget();
void applyState(GLenum drawMode);
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Device.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Device.cpp
index 0f9d3e57c37..cb95d0cc10e 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Device.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Device.cpp
@@ -250,7 +250,7 @@ namespace es1
UNREACHABLE(format);
}
- egl::Image *surface = new egl::Image(width, height, format, multiSampleDepth, lockable);
+ egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface)
{
@@ -269,7 +269,7 @@ namespace es1
return nullptr;
}
- egl::Image *surface = new egl::Image(width, height, format, multiSampleDepth, lockable);
+ egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface)
{
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.cpp
index a5c86a78300..58b80d013ef 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.cpp
@@ -23,7 +23,7 @@
#include "Framebuffer.h"
#include "Device.hpp"
#include "libEGL/Display.h"
-#include "libEGL/EGLSurface.h"
+#include "common/Surface.hpp"
#include "common/debug.h"
#include <algorithm>
@@ -227,13 +227,13 @@ egl::Image *Texture::createSharedImage(GLenum target, unsigned int level)
return image;
}
-void Texture::setImage(GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image)
+void Texture::setImage(egl::Context *context, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image)
{
if(pixels && image)
{
egl::Image::UnpackInfo unpackInfo;
unpackInfo.alignment = unpackAlignment;
- image->loadImageData(0, 0, 0, image->getWidth(), image->getHeight(), 1, format, type, unpackInfo, pixels);
+ image->loadImageData(context, 0, 0, 0, image->getWidth(), image->getHeight(), 1, format, type, unpackInfo, pixels);
}
}
@@ -245,7 +245,7 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, egl::Ima
}
}
-void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image)
+void Texture::subImage(egl::Context *context, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image)
{
if(!image)
{
@@ -271,7 +271,7 @@ void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
{
egl::Image::UnpackInfo unpackInfo;
unpackInfo.alignment = unpackAlignment;
- image->loadImageData(xoffset, yoffset, 0, width, height, 1, format, type, unpackInfo, pixels);
+ image->loadImageData(context, xoffset, yoffset, 0, width, height, 1, format, type, unpackInfo, pixels);
}
}
@@ -457,24 +457,24 @@ int Texture2D::getLevelCount() const
return levels;
}
-void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
+void Texture2D::setImage(egl::Context *context, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{
if(image[level])
{
image[level]->release();
}
- image[level] = new egl::Image(this, width, height, format, type);
+ image[level] = egl::Image::create(this, width, height, format, type);
if(!image[level])
{
return error(GL_OUT_OF_MEMORY);
}
- Texture::setImage(format, type, unpackAlignment, pixels, image[level]);
+ Texture::setImage(context, format, type, unpackAlignment, pixels, image[level]);
}
-void Texture2D::bindTexImage(egl::Surface *surface)
+void Texture2D::bindTexImage(gl::Surface *surface)
{
GLenum format;
@@ -529,7 +529,7 @@ void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
image[level]->release();
}
- image[level] = new egl::Image(this, width, height, format, GL_UNSIGNED_BYTE);
+ image[level] = egl::Image::create(this, width, height, format, GL_UNSIGNED_BYTE);
if(!image[level])
{
@@ -539,9 +539,9 @@ void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
Texture::setCompressedImage(imageSize, pixels, image[level]);
}
-void Texture2D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
+void Texture2D::subImage(egl::Context *context, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{
- Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, image[level]);
+ Texture::subImage(context, xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, image[level]);
}
void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
@@ -564,7 +564,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
image[level]->release();
}
- image[level] = new egl::Image(this, width, height, format, GL_UNSIGNED_BYTE);
+ image[level] = egl::Image::create(this, width, height, format, GL_UNSIGNED_BYTE);
if(!image[level])
{
@@ -714,7 +714,7 @@ void Texture2D::generateMipmaps()
image[i]->release();
}
- image[i] = new egl::Image(this, std::max(image[0]->getWidth() >> i, 1), std::max(image[0]->getHeight() >> i, 1), image[0]->getFormat(), image[0]->getType());
+ image[i] = egl::Image::create(this, std::max(image[0]->getWidth() >> i, 1), std::max(image[0]->getHeight() >> i, 1), image[0]->getFormat(), image[0]->getType());
if(!image[i])
{
@@ -804,22 +804,23 @@ GLenum TextureExternal::getTarget() const
}
-egl::Image *createBackBuffer(int width, int height, const egl::Config *config)
+egl::Image *createBackBuffer(int width, int height, sw::Format format, int multiSampleDepth)
{
- if(config)
+ if(width > es1::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE || height > es1::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE)
{
- return new egl::Image(width, height, config->mRenderTargetFormat, config->mSamples, false);
+ ERR("Invalid parameters: %dx%d", width, height);
+ return nullptr;
}
- return nullptr;
+ return egl::Image::create(width, height, format, multiSampleDepth, false);
}
-egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
+egl::Image *createDepthStencil(int width, int height, sw::Format format, int multiSampleDepth)
{
- if(height > sw::OUTLINE_RESOLUTION)
+ if(width > es1::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE || height > es1::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE)
{
ERR("Invalid parameters: %dx%d", width, height);
- return 0;
+ return nullptr;
}
bool lockable = true;
@@ -847,7 +848,7 @@ egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Form
UNREACHABLE(format);
}
- egl::Image *surface = new egl::Image(width, height, format, multiSampleDepth, lockable);
+ egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface)
{
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.h b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.h
index ba0c4d51cd4..c99c1dcf71b 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/Texture.h
@@ -29,11 +29,7 @@
#include <vector>
-namespace egl
-{
-class Surface;
-class Config;
-}
+namespace gl { class Surface; }
namespace es1
{
@@ -91,7 +87,7 @@ public:
virtual Renderbuffer *getRenderbuffer(GLenum target) = 0;
virtual egl::Image *getRenderTarget(GLenum target, unsigned int level) = 0;
- virtual egl::Image *createSharedImage(GLenum target, unsigned int level);
+ egl::Image *createSharedImage(GLenum target, unsigned int level);
virtual bool isShared(GLenum target, unsigned int level) const = 0;
virtual void generateMipmaps() = 0;
@@ -100,10 +96,10 @@ public:
virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) = 0;
protected:
- virtual ~Texture();
+ ~Texture() override;
- void setImage(GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image);
- void subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image);
+ void setImage(egl::Context *context, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image);
+ void subImage(egl::Context *context, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, egl::Image *image);
void setCompressedImage(GLsizei imageSize, const void *pixels, egl::Image *image);
void subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, egl::Image *image);
@@ -134,47 +130,47 @@ public:
void releaseProxy(const Renderbuffer *proxy) override;
void sweep() override;
- virtual GLenum getTarget() const;
+ GLenum getTarget() const override;
- virtual GLsizei getWidth(GLenum target, GLint level) const;
- virtual GLsizei getHeight(GLenum target, GLint level) const;
- virtual GLenum getFormat(GLenum target, GLint level) const;
- virtual GLenum getType(GLenum target, GLint level) const;
- virtual sw::Format getInternalFormat(GLenum target, GLint level) const;
- virtual int getLevelCount() const;
+ GLsizei getWidth(GLenum target, GLint level) const override;
+ GLsizei getHeight(GLenum target, GLint level) const override;
+ GLenum getFormat(GLenum target, GLint level) const override;
+ GLenum getType(GLenum target, GLint level) const override;
+ sw::Format getInternalFormat(GLenum target, GLint level) const override;
+ int getLevelCount() const override;
- void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
+ void setImage(egl::Context *context, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
- void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
+ void subImage(egl::Context *context, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void setSharedImage(egl::Image *image);
- virtual bool isSamplerComplete() const;
- virtual bool isCompressed(GLenum target, GLint level) const;
- virtual bool isDepth(GLenum target, GLint level) const;
- virtual void bindTexImage(egl::Surface *surface);
- virtual void releaseTexImage();
+ bool isSamplerComplete() const override;
+ bool isCompressed(GLenum target, GLint level) const override;
+ bool isDepth(GLenum target, GLint level) const override;
+ void bindTexImage(gl::Surface *surface);
+ void releaseTexImage() override;
- virtual void generateMipmaps();
- virtual void autoGenerateMipmaps();
+ void generateMipmaps() override;
+ void autoGenerateMipmaps() override;
- virtual Renderbuffer *getRenderbuffer(GLenum target);
- virtual egl::Image *getRenderTarget(GLenum target, unsigned int level);
- virtual bool isShared(GLenum target, unsigned int level) const;
+ Renderbuffer *getRenderbuffer(GLenum target) override;
+ egl::Image *getRenderTarget(GLenum target, unsigned int level) override;
+ bool isShared(GLenum target, unsigned int level) const override;
egl::Image *getImage(unsigned int level);
protected:
- virtual ~Texture2D();
+ ~Texture2D() override;
bool isMipmapComplete() const;
egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
- egl::Surface *mSurface;
+ gl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer
@@ -190,10 +186,10 @@ class TextureExternal : public Texture2D
public:
explicit TextureExternal(GLuint name);
- virtual GLenum getTarget() const;
+ GLenum getTarget() const override;
protected:
- virtual ~TextureExternal();
+ ~TextureExternal() override;
};
}
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.cpp
index b47ce13d915..62acae13b44 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.cpp
@@ -4320,7 +4320,7 @@ void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width,
return error(GL_INVALID_OPERATION);
}
- texture->setImage(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+ texture->setImage(context, level, width, height, format, type, context->getUnpackAlignment(), pixels);
}
else UNREACHABLE(target);
}
@@ -4557,7 +4557,7 @@ void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLs
if(validateSubImageParams(false, width, height, xoffset, yoffset, target, level, format, texture))
{
- texture->subImage(level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
+ texture->subImage(context, level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
}
}
else UNREACHABLE(target);
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp
index 1c66f185b9c..5a3a2897c7b 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp
@@ -221,8 +221,8 @@ public:
egl::Context *(*es1CreateContext)(egl::Display *display, const egl::Context *shareContext, const egl::Config *config);
__eglMustCastToProperFunctionPointerType (*es1GetProcAddress)(const char *procname);
- egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
- egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
+ egl::Image *(*createBackBuffer)(int width, int height, sw::Format format, int multiSampleDepth);
+ egl::Image *(*createDepthStencil)(int width, int height, sw::Format format, int multiSampleDepth);
sw::FrameBuffer *(*createFrameBuffer)(void *nativeDisplay, EGLNativeWindowType window, int width, int height);
};
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/main.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/main.cpp
index 036147ffda1..f2bd0b78f95 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/main.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLES_CM/main.cpp
@@ -18,7 +18,7 @@
#include "libGLES_CM.hpp"
#include "Framebuffer.h"
-#include "libEGL/EGLSurface.h"
+#include "common/Surface.hpp"
#include "Common/Thread.hpp"
#include "Common/SharedLibrary.hpp"
#include "common/debug.h"
@@ -93,14 +93,14 @@ es1::Context *getContext()
return static_cast<es1::Context*>(context);
}
- return 0;
+ return nullptr;
}
Device *getDevice()
{
Context *context = getContext();
- return context ? context->getDevice() : 0;
+ return context ? context->getDevice() : nullptr;
}
// Records an error code
@@ -332,8 +332,8 @@ void DrawTexfvOES(const GLfloat *coords);
egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext, const egl::Config *config);
extern "C" __eglMustCastToProperFunctionPointerType es1GetProcAddress(const char *procname);
-egl::Image *createBackBuffer(int width, int height, const egl::Config *config);
-egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
+egl::Image *createBackBuffer(int width, int height, sw::Format format, int multiSampleDepth);
+egl::Image *createDepthStencil(int width, int height, sw::Format format, int multiSampleDepth);
sw::FrameBuffer *createFrameBuffer(void *nativeDisplay, EGLNativeWindowType window, int width, int height);
extern "C"
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Android.mk b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Android.mk
index d630de348c1..3357d2a447f 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Android.mk
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Android.mk
@@ -64,6 +64,12 @@ COMMON_SHARED_LIBRARIES := \
libcutils \
libhardware
+# gralloc1 is introduced from N MR1
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1)
+COMMON_CFLAGS += -DHAVE_GRALLOC1
+COMMON_SHARED_LIBRARIES += libsync
+endif
+
# Marshmallow does not have stlport, but comes with libc++ by default
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
COMMON_SHARED_LIBRARIES += libstlport
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn
index 59f4f6d8699..102d82580bb 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import("//build/toolchain/toolchain.gni")
-
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_libGLESv2_private_config") {
defines = [
@@ -49,13 +47,8 @@ config("swiftshader_libGLESv2_private_config") {
"LOG_TAG=\"swiftshader_libGLESv2\"",
"__STDC_CONSTANT_MACROS",
"__STDC_LIMIT_MACROS",
+ "GL_APICALL=__attribute__((visibility(\"default\")))",
]
-
- if (is_linux) {
- defines += [ "GL_APICALL=__attribute__((visibility(\"protected\")))" ]
- } else {
- defines += [ "GL_APICALL=__attribute__((visibility(\"default\")))" ]
- }
}
}
@@ -69,6 +62,7 @@ shared_library("swiftshader_libGLESv2") {
"../../OpenGL/compiler:swiftshader_opengl_compiler",
"../../Reactor:swiftshader_reactor",
"../../Renderer:swiftshader_renderer",
+ "//build/config:exe_and_shlib_deps",
]
sources = [
@@ -99,24 +93,13 @@ shared_library("swiftshader_libGLESv2") {
if (is_win) {
configs -= [ "//build/config/win:unicode" ]
ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
+ } else if (is_mac) {
+ ldflags = [ "-Wl,-install_name,@rpath/libswiftshader_libGLESv2.dylib" ]
} else if (is_linux) {
- sources += [ "TypeInfo.cpp" ]
ldflags =
[ "-Wl,--version-script=" + rebase_path("exports.map", root_build_dir) ]
}
- if (use_thin_lto) {
- # https://crbug.com/686980
- # This target relies on the linker to be smart and garbage collect unused symbols.
- # It is not the case for LLD + ThinLTO, so we have to use this ugly workaround.
- cflags = [
- "-Xclang",
- "-fno-lto-unit",
- "-fno-whole-program-vtables",
- "-fno-sanitize=cfi",
- ]
- }
-
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.cpp
index 00ad92cde5f..c1390689aa5 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.cpp
@@ -35,7 +35,7 @@
#include "VertexDataManager.h"
#include "IndexDataManager.h"
#include "libEGL/Display.h"
-#include "libEGL/EGLSurface.h"
+#include "common/Surface.hpp"
#include "Common/Half.hpp"
#include <EGL/eglext.h>
@@ -100,6 +100,7 @@ Context::Context(egl::Display *display, const Context *shareContext, EGLint clie
mState.rasterizerDiscardEnabled = false;
mState.generateMipmapHint = GL_DONT_CARE;
mState.fragmentShaderDerivativeHint = GL_DONT_CARE;
+ mState.textureFilteringHint = GL_DONT_CARE;
mState.lineWidth = 1.0f;
@@ -245,6 +246,11 @@ Context::~Context()
mState.pixelPackBuffer = nullptr;
mState.pixelUnpackBuffer = nullptr;
mState.genericUniformBuffer = nullptr;
+
+ for(int i = 0; i < MAX_UNIFORM_BUFFER_BINDINGS; i++) {
+ mState.uniformBuffers[i].set(nullptr, 0, 0);
+ }
+
mState.renderbuffer = nullptr;
for(int i = 0; i < MAX_COMBINED_TEXTURE_IMAGE_UNITS; ++i)
@@ -265,7 +271,7 @@ Context::~Context()
delete device;
}
-void Context::makeCurrent(egl::Surface *surface)
+void Context::makeCurrent(gl::Surface *surface)
{
if(!mHasBeenCurrent)
{
@@ -274,35 +280,42 @@ void Context::makeCurrent(egl::Surface *surface)
mState.viewportX = 0;
mState.viewportY = 0;
- mState.viewportWidth = surface->getWidth();
- mState.viewportHeight = surface->getHeight();
+ mState.viewportWidth = surface ? surface->getWidth() : 0;
+ mState.viewportHeight = surface ? surface->getHeight() : 0;
mState.scissorX = 0;
mState.scissorY = 0;
- mState.scissorWidth = surface->getWidth();
- mState.scissorHeight = surface->getHeight();
+ mState.scissorWidth = surface ? surface->getWidth() : 0;
+ mState.scissorHeight = surface ? surface->getHeight() : 0;
mHasBeenCurrent = true;
}
- // Wrap the existing resources into GL objects and assign them to the '0' names
- egl::Image *defaultRenderTarget = surface->getRenderTarget();
- egl::Image *depthStencil = surface->getDepthStencil();
+ if(surface)
+ {
+ // Wrap the existing resources into GL objects and assign them to the '0' names
+ egl::Image *defaultRenderTarget = surface->getRenderTarget();
+ egl::Image *depthStencil = surface->getDepthStencil();
- Colorbuffer *colorbufferZero = new Colorbuffer(defaultRenderTarget);
- DepthStencilbuffer *depthStencilbufferZero = new DepthStencilbuffer(depthStencil);
- Framebuffer *framebufferZero = new DefaultFramebuffer(colorbufferZero, depthStencilbufferZero);
+ Colorbuffer *colorbufferZero = new Colorbuffer(defaultRenderTarget);
+ DepthStencilbuffer *depthStencilbufferZero = new DepthStencilbuffer(depthStencil);
+ Framebuffer *framebufferZero = new DefaultFramebuffer(colorbufferZero, depthStencilbufferZero);
- setFramebufferZero(framebufferZero);
+ setFramebufferZero(framebufferZero);
- if(defaultRenderTarget)
- {
- defaultRenderTarget->release();
- }
+ if(defaultRenderTarget)
+ {
+ defaultRenderTarget->release();
+ }
- if(depthStencil)
+ if(depthStencil)
+ {
+ depthStencil->release();
+ }
+ }
+ else
{
- depthStencil->release();
+ setFramebufferZero(nullptr);
}
markAllStateDirty();
@@ -670,6 +683,11 @@ void Context::setFragmentShaderDerivativeHint(GLenum hint)
// Ignore for now. It is valid for implementations to ignore hint.
}
+void Context::setTextureFilteringHint(GLenum hint)
+{
+ mState.textureFilteringHint = hint;
+}
+
void Context::setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height)
{
mState.viewportX = x;
@@ -1878,6 +1896,7 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
case GL_UNPACK_ALIGNMENT: *params = mState.unpackInfo.alignment; return true;
case GL_GENERATE_MIPMAP_HINT: *params = mState.generateMipmapHint; return true;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: *params = mState.fragmentShaderDerivativeHint; return true;
+ case GL_TEXTURE_FILTERING_HINT_CHROMIUM: *params = mState.textureFilteringHint; return true;
case GL_ACTIVE_TEXTURE: *params = (mState.activeSampler + GL_TEXTURE0); return true;
case GL_STENCIL_FUNC: *params = mState.stencilFunc; return true;
case GL_STENCIL_REF: *params = mState.stencilRef; return true;
@@ -2096,6 +2115,9 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
case GL_MAX_DRAW_BUFFERS:
*params = MAX_DRAW_BUFFERS;
return true;
+ case GL_MAX_COLOR_ATTACHMENTS: // Note: MAX_COLOR_ATTACHMENTS_EXT added by GL_EXT_draw_buffers
+ *params = MAX_COLOR_ATTACHMENTS;
+ return true;
default:
break;
}
@@ -2128,9 +2150,6 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
case GL_MAX_ARRAY_TEXTURE_LAYERS:
*params = IMPLEMENTATION_MAX_TEXTURE_SIZE;
return true;
- case GL_MAX_COLOR_ATTACHMENTS: // Note: not supported in OES_framebuffer_object
- *params = MAX_COLOR_ATTACHMENTS;
- return true;
case GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:
*params = MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS;
return true;
@@ -2413,6 +2432,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_UNPACK_ALIGNMENT:
case GL_GENERATE_MIPMAP_HINT:
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
+ case GL_TEXTURE_FILTERING_HINT_CHROMIUM:
case GL_RED_BITS:
case GL_GREEN_BITS:
case GL_BLUE_BITS:
@@ -2969,9 +2989,9 @@ void Context::applyShaders()
mAppliedProgramSerial = programObject->getSerial();
}
- programObject->applyTransformFeedback(getTransformFeedback());
- programObject->applyUniformBuffers(mState.uniformBuffers);
- programObject->applyUniforms();
+ programObject->applyTransformFeedback(device, getTransformFeedback());
+ programObject->applyUniformBuffers(device, mState.uniformBuffers);
+ programObject->applyUniforms(device);
}
void Context::applyTextures()
@@ -3046,6 +3066,7 @@ void Context::applyTextures(sw::SamplerType samplerType)
device->setTextureFilter(samplerType, samplerIndex, es2sw::ConvertTextureFilter(minFilter, magFilter, maxAnisotropy));
device->setMipmapFilter(samplerType, samplerIndex, es2sw::ConvertMipMapFilter(minFilter));
device->setMaxAnisotropy(samplerType, samplerIndex, maxAnisotropy);
+ device->setHighPrecisionFiltering(samplerType, samplerIndex, mState.textureFilteringHint == GL_NICEST);
applyTexture(samplerType, samplerIndex, texture);
}
@@ -3241,10 +3262,11 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
sw::Rect dstRect = { 0, 0, width, height };
rect.clip(0, 0, renderTarget->getWidth(), renderTarget->getHeight());
- sw::Surface externalSurface(width, height, 1, egl::ConvertFormatType(format, type), pixels, outputPitch, outputPitch * outputHeight);
+ sw::Surface *externalSurface = sw::Surface::create(width, height, 1, egl::ConvertFormatType(format, type), pixels, outputPitch, outputPitch * outputHeight);
sw::SliceRect sliceRect(rect);
sw::SliceRect dstSliceRect(dstRect);
- device->blit(renderTarget, sliceRect, &externalSurface, dstSliceRect, false);
+ device->blit(renderTarget, sliceRect, externalSurface, dstSliceRect, false);
+ delete externalSurface;
renderTarget->release();
}
@@ -3509,6 +3531,11 @@ void Context::drawElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
}
}
+void Context::blit(sw::Surface *source, const sw::SliceRect &sRect, sw::Surface *dest, const sw::SliceRect &dRect)
+{
+ device->blit(source, sRect, dest, dRect, false);
+}
+
void Context::finish()
{
device->finish();
@@ -4137,7 +4164,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
}
}
-void Context::bindTexImage(egl::Surface *surface)
+void Context::bindTexImage(gl::Surface *surface)
{
es2::Texture2D *textureObject = getTexture2D();
@@ -4298,6 +4325,7 @@ const GLubyte *Context::getExtensions(GLuint index, GLuint *numExt) const
#endif
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_format_BGRA8888",
+ "GL_EXT_texture_rg",
"GL_ANGLE_framebuffer_blit",
"GL_ANGLE_framebuffer_multisample",
"GL_ANGLE_instanced_arrays",
@@ -4305,6 +4333,7 @@ const GLubyte *Context::getExtensions(GLuint index, GLuint *numExt) const
"GL_ANGLE_texture_compression_dxt3",
"GL_ANGLE_texture_compression_dxt5",
#endif
+ "GL_CHROMIUM_texture_filtering_hint",
"GL_NV_fence",
"GL_NV_framebuffer_blit",
"GL_NV_read_depth",
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.h b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.h
index a8e450a71a6..16e0aa27f75 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Context.h
@@ -37,7 +37,6 @@
namespace egl
{
class Display;
-class Surface;
class Config;
}
@@ -157,6 +156,8 @@ const GLenum compressedTextureFormats[] =
#endif
};
+const GLenum GL_TEXTURE_FILTERING_HINT_CHROMIUM = 0x8AF0;
+
const GLint NUM_COMPRESSED_TEXTURE_FORMATS = sizeof(compressedTextureFormats) / sizeof(compressedTextureFormats[0]);
const GLint multisampleCount[] = {4, 2, 1};
@@ -377,6 +378,7 @@ struct State
GLenum generateMipmapHint;
GLenum fragmentShaderDerivativeHint;
+ GLenum textureFilteringHint;
GLint viewportX;
GLint viewportY;
@@ -431,7 +433,7 @@ class [[clang::lto_visibility_public]] Context : public egl::Context
public:
Context(egl::Display *display, const Context *shareContext, EGLint clientVersion, const egl::Config *config);
- void makeCurrent(egl::Surface *surface) override;
+ void makeCurrent(gl::Surface *surface) override;
EGLint getClientVersion() const override;
EGLint getConfigID() const override;
@@ -490,6 +492,7 @@ public:
void setGenerateMipmapHint(GLenum hint);
void setFragmentShaderDerivativeHint(GLenum hint);
+ void setTextureFilteringHint(GLenum hint);
void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height);
@@ -665,6 +668,9 @@ public:
bool hasZeroDivisor() const;
+ void drawArrays(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount = 1);
+ void drawElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount = 1);
+ void blit(sw::Surface *source, const sw::SliceRect &sRect, sw::Surface *dest, const sw::SliceRect &dRect) override;
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei *bufSize, void* pixels);
void clear(GLbitfield mask);
void clearColorBuffer(GLint drawbuffer, const GLint *value);
@@ -672,8 +678,6 @@ public:
void clearColorBuffer(GLint drawbuffer, const GLfloat *value);
void clearDepthBuffer(const GLfloat value);
void clearStencilBuffer(const GLint value);
- void drawArrays(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount = 1);
- void drawElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount = 1);
void finish() override;
void flush();
@@ -691,7 +695,7 @@ public:
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, bool filter, bool allowPartialDepthStencilBlit);
- void bindTexImage(egl::Surface *surface) override;
+ void bindTexImage(gl::Surface *surface) override;
EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
egl::Image *getSharedImage(GLeglImageOES image);
@@ -701,7 +705,7 @@ public:
const GLubyte *getExtensions(GLuint index, GLuint *numExt = nullptr) const;
private:
- virtual ~Context();
+ ~Context() override;
void applyScissor(int width, int height);
bool applyRenderTarget();
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Device.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Device.cpp
index da1583f9b6e..8b8f016defc 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Device.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Device.cpp
@@ -290,7 +290,7 @@ namespace es2
UNREACHABLE(format);
}
- egl::Image *surface = new egl::Image(width, height, format, multiSampleDepth, lockable);
+ egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface)
{
@@ -309,7 +309,7 @@ namespace es2
return nullptr;
}
- egl::Image *surface = new egl::Image(width, height, format, multiSampleDepth, lockable);
+ egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface)
{
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.cpp
index 400da5d4f70..24d1f3c78ed 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.cpp
@@ -151,8 +151,6 @@ namespace es2
Program::Program(ResourceManager *manager, GLuint handle) : serial(issueSerial()), resourceManager(manager), handle(handle)
{
- device = getDevice();
-
fragmentShader = 0;
vertexShader = 0;
pixelBinary = 0;
@@ -1064,7 +1062,7 @@ namespace es2
}
// Applies all the uniforms set for this program object to the device
- void Program::applyUniforms()
+ void Program::applyUniforms(Device *device)
{
GLint numUniforms = static_cast<GLint>(uniformIndex.size());
for(GLint location = 0; location < numUniforms; location++)
@@ -1086,23 +1084,23 @@ namespace es2
switch(targetUniform->type)
{
- case GL_BOOL: applyUniform1bv(location, size, b); break;
- case GL_BOOL_VEC2: applyUniform2bv(location, size, b); break;
- case GL_BOOL_VEC3: applyUniform3bv(location, size, b); break;
- case GL_BOOL_VEC4: applyUniform4bv(location, size, b); break;
- case GL_FLOAT: applyUniform1fv(location, size, f); break;
- case GL_FLOAT_VEC2: applyUniform2fv(location, size, f); break;
- case GL_FLOAT_VEC3: applyUniform3fv(location, size, f); break;
- case GL_FLOAT_VEC4: applyUniform4fv(location, size, f); break;
- case GL_FLOAT_MAT2: applyUniformMatrix2fv(location, size, f); break;
- case GL_FLOAT_MAT2x3: applyUniformMatrix2x3fv(location, size, f); break;
- case GL_FLOAT_MAT2x4: applyUniformMatrix2x4fv(location, size, f); break;
- case GL_FLOAT_MAT3x2: applyUniformMatrix3x2fv(location, size, f); break;
- case GL_FLOAT_MAT3: applyUniformMatrix3fv(location, size, f); break;
- case GL_FLOAT_MAT3x4: applyUniformMatrix3x4fv(location, size, f); break;
- case GL_FLOAT_MAT4x2: applyUniformMatrix4x2fv(location, size, f); break;
- case GL_FLOAT_MAT4x3: applyUniformMatrix4x3fv(location, size, f); break;
- case GL_FLOAT_MAT4: applyUniformMatrix4fv(location, size, f); break;
+ case GL_BOOL: applyUniform1bv(device, location, size, b); break;
+ case GL_BOOL_VEC2: applyUniform2bv(device, location, size, b); break;
+ case GL_BOOL_VEC3: applyUniform3bv(device, location, size, b); break;
+ case GL_BOOL_VEC4: applyUniform4bv(device, location, size, b); break;
+ case GL_FLOAT: applyUniform1fv(device, location, size, f); break;
+ case GL_FLOAT_VEC2: applyUniform2fv(device, location, size, f); break;
+ case GL_FLOAT_VEC3: applyUniform3fv(device, location, size, f); break;
+ case GL_FLOAT_VEC4: applyUniform4fv(device, location, size, f); break;
+ case GL_FLOAT_MAT2: applyUniformMatrix2fv(device, location, size, f); break;
+ case GL_FLOAT_MAT2x3: applyUniformMatrix2x3fv(device, location, size, f); break;
+ case GL_FLOAT_MAT2x4: applyUniformMatrix2x4fv(device, location, size, f); break;
+ case GL_FLOAT_MAT3x2: applyUniformMatrix3x2fv(device, location, size, f); break;
+ case GL_FLOAT_MAT3: applyUniformMatrix3fv(device, location, size, f); break;
+ case GL_FLOAT_MAT3x4: applyUniformMatrix3x4fv(device, location, size, f); break;
+ case GL_FLOAT_MAT4x2: applyUniformMatrix4x2fv(device, location, size, f); break;
+ case GL_FLOAT_MAT4x3: applyUniformMatrix4x3fv(device, location, size, f); break;
+ case GL_FLOAT_MAT4: applyUniformMatrix4fv(device, location, size, f); break;
case GL_SAMPLER_2D:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_EXTERNAL_OES:
@@ -1119,14 +1117,14 @@ namespace es2
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
- case GL_INT: applyUniform1iv(location, size, i); break;
- case GL_INT_VEC2: applyUniform2iv(location, size, i); break;
- case GL_INT_VEC3: applyUniform3iv(location, size, i); break;
- case GL_INT_VEC4: applyUniform4iv(location, size, i); break;
- case GL_UNSIGNED_INT: applyUniform1uiv(location, size, ui); break;
- case GL_UNSIGNED_INT_VEC2: applyUniform2uiv(location, size, ui); break;
- case GL_UNSIGNED_INT_VEC3: applyUniform3uiv(location, size, ui); break;
- case GL_UNSIGNED_INT_VEC4: applyUniform4uiv(location, size, ui); break;
+ case GL_INT: applyUniform1iv(device, location, size, i); break;
+ case GL_INT_VEC2: applyUniform2iv(device, location, size, i); break;
+ case GL_INT_VEC3: applyUniform3iv(device, location, size, i); break;
+ case GL_INT_VEC4: applyUniform4iv(device, location, size, i); break;
+ case GL_UNSIGNED_INT: applyUniform1uiv(device, location, size, ui); break;
+ case GL_UNSIGNED_INT_VEC2: applyUniform2uiv(device, location, size, ui); break;
+ case GL_UNSIGNED_INT_VEC3: applyUniform3uiv(device, location, size, ui); break;
+ case GL_UNSIGNED_INT_VEC4: applyUniform4uiv(device, location, size, ui); break;
default:
UNREACHABLE(targetUniform->type);
}
@@ -1136,7 +1134,7 @@ namespace es2
}
}
- void Program::applyUniformBuffers(BufferBinding* uniformBuffers)
+ void Program::applyUniformBuffers(Device *device, BufferBinding* uniformBuffers)
{
GLint vertexUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS];
GLint fragmentUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS];
@@ -1189,7 +1187,7 @@ namespace es2
}
}
- void Program::applyTransformFeedback(TransformFeedback* transformFeedback)
+ void Program::applyTransformFeedback(Device *device, TransformFeedback* transformFeedback)
{
// Make sure the flags will fit in a 64 bit unsigned int variable
ASSERT(sw::max<int>(MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, sw::MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS) <= 64);
@@ -1930,7 +1928,7 @@ namespace es2
return true;
}
- bool Program::applyUniform(GLint location, float* data)
+ bool Program::applyUniform(Device *device, GLint location, float* data)
{
Uniform *targetUniform = uniforms[uniformIndex[location].index];
@@ -1947,7 +1945,7 @@ namespace es2
return true;
}
- bool Program::applyUniform1bv(GLint location, GLsizei count, const GLboolean *v)
+ bool Program::applyUniform1bv(Device *device, GLint location, GLsizei count, const GLboolean *v)
{
int vector[MAX_UNIFORM_VECTORS][4];
@@ -1961,10 +1959,10 @@ namespace es2
v += 1;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform2bv(GLint location, GLsizei count, const GLboolean *v)
+ bool Program::applyUniform2bv(Device *device, GLint location, GLsizei count, const GLboolean *v)
{
int vector[MAX_UNIFORM_VECTORS][4];
@@ -1978,10 +1976,10 @@ namespace es2
v += 2;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform3bv(GLint location, GLsizei count, const GLboolean *v)
+ bool Program::applyUniform3bv(Device *device, GLint location, GLsizei count, const GLboolean *v)
{
int vector[MAX_UNIFORM_VECTORS][4];
@@ -1995,10 +1993,10 @@ namespace es2
v += 3;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform4bv(GLint location, GLsizei count, const GLboolean *v)
+ bool Program::applyUniform4bv(Device *device, GLint location, GLsizei count, const GLboolean *v)
{
int vector[MAX_UNIFORM_VECTORS][4];
@@ -2012,10 +2010,10 @@ namespace es2
v += 4;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform1fv(GLint location, GLsizei count, const GLfloat *v)
+ bool Program::applyUniform1fv(Device *device, GLint location, GLsizei count, const GLfloat *v)
{
float vector[MAX_UNIFORM_VECTORS][4];
@@ -2029,10 +2027,10 @@ namespace es2
v += 1;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform2fv(GLint location, GLsizei count, const GLfloat *v)
+ bool Program::applyUniform2fv(Device *device, GLint location, GLsizei count, const GLfloat *v)
{
float vector[MAX_UNIFORM_VECTORS][4];
@@ -2046,10 +2044,10 @@ namespace es2
v += 2;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform3fv(GLint location, GLsizei count, const GLfloat *v)
+ bool Program::applyUniform3fv(Device *device, GLint location, GLsizei count, const GLfloat *v)
{
float vector[MAX_UNIFORM_VECTORS][4];
@@ -2063,15 +2061,15 @@ namespace es2
v += 3;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform4fv(GLint location, GLsizei count, const GLfloat *v)
+ bool Program::applyUniform4fv(Device *device, GLint location, GLsizei count, const GLfloat *v)
{
- return applyUniform(location, (float*)v);
+ return applyUniform(device, location, (float*)v);
}
- bool Program::applyUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix2fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 1) / 2][2][4];
@@ -2083,10 +2081,10 @@ namespace es2
value += 4;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix2x3fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix2x3fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 1) / 2][2][4];
@@ -2098,10 +2096,10 @@ namespace es2
value += 6;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix2x4fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix2x4fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 1) / 2][2][4];
@@ -2113,10 +2111,10 @@ namespace es2
value += 8;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix3fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 2) / 3][3][4];
@@ -2129,10 +2127,10 @@ namespace es2
value += 9;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix3x2fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix3x2fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 2) / 3][3][4];
@@ -2145,10 +2143,10 @@ namespace es2
value += 6;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix3x4fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix3x4fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 2) / 3][3][4];
@@ -2161,15 +2159,15 @@ namespace es2
value += 12;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix4fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
- return applyUniform(location, (float*)value);
+ return applyUniform(device, location, (float*)value);
}
- bool Program::applyUniformMatrix4x2fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix4x2fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 3) / 4][4][4];
@@ -2183,10 +2181,10 @@ namespace es2
value += 8;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniformMatrix4x3fv(GLint location, GLsizei count, const GLfloat *value)
+ bool Program::applyUniformMatrix4x3fv(Device *device, GLint location, GLsizei count, const GLfloat *value)
{
float matrix[(MAX_UNIFORM_VECTORS + 3) / 4][4][4];
@@ -2200,10 +2198,10 @@ namespace es2
value += 12;
}
- return applyUniform(location, (float*)matrix);
+ return applyUniform(device, location, (float*)matrix);
}
- bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
+ bool Program::applyUniform1iv(Device *device, GLint location, GLsizei count, const GLint *v)
{
GLint vector[MAX_UNIFORM_VECTORS][4];
@@ -2248,13 +2246,13 @@ namespace es2
}
else
{
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
return true;
}
- bool Program::applyUniform2iv(GLint location, GLsizei count, const GLint *v)
+ bool Program::applyUniform2iv(Device *device, GLint location, GLsizei count, const GLint *v)
{
GLint vector[MAX_UNIFORM_VECTORS][4];
@@ -2268,10 +2266,10 @@ namespace es2
v += 2;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform3iv(GLint location, GLsizei count, const GLint *v)
+ bool Program::applyUniform3iv(Device *device, GLint location, GLsizei count, const GLint *v)
{
GLint vector[MAX_UNIFORM_VECTORS][4];
@@ -2285,10 +2283,10 @@ namespace es2
v += 3;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform4iv(GLint location, GLsizei count, const GLint *v)
+ bool Program::applyUniform4iv(Device *device, GLint location, GLsizei count, const GLint *v)
{
GLint vector[MAX_UNIFORM_VECTORS][4];
@@ -2302,10 +2300,10 @@ namespace es2
v += 4;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform1uiv(GLint location, GLsizei count, const GLuint *v)
+ bool Program::applyUniform1uiv(Device *device, GLint location, GLsizei count, const GLuint *v)
{
GLuint vector[MAX_UNIFORM_VECTORS][4];
@@ -2350,13 +2348,13 @@ namespace es2
}
else
{
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
return true;
}
- bool Program::applyUniform2uiv(GLint location, GLsizei count, const GLuint *v)
+ bool Program::applyUniform2uiv(Device *device, GLint location, GLsizei count, const GLuint *v)
{
GLuint vector[MAX_UNIFORM_VECTORS][4];
@@ -2370,10 +2368,10 @@ namespace es2
v += 2;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform3uiv(GLint location, GLsizei count, const GLuint *v)
+ bool Program::applyUniform3uiv(Device *device, GLint location, GLsizei count, const GLuint *v)
{
GLuint vector[MAX_UNIFORM_VECTORS][4];
@@ -2387,10 +2385,10 @@ namespace es2
v += 3;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
- bool Program::applyUniform4uiv(GLint location, GLsizei count, const GLuint *v)
+ bool Program::applyUniform4uiv(Device *device, GLint location, GLsizei count, const GLuint *v)
{
GLuint vector[MAX_UNIFORM_VECTORS][4];
@@ -2404,7 +2402,7 @@ namespace es2
v += 4;
}
- return applyUniform(location, (float*)vector);
+ return applyUniform(device, location, (float*)vector);
}
void Program::appendToInfoLog(const char *format, ...)
@@ -2875,7 +2873,7 @@ namespace es2
return orphaned;
}
- void Program::validate()
+ void Program::validate(Device* device)
{
resetInfoLog();
@@ -2886,7 +2884,7 @@ namespace es2
}
else
{
- applyUniforms();
+ applyUniforms(device);
if(!validateSamplers(true))
{
validated = false;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.h b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.h
index ff4bc5f0239..56f7df74bf5 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Program.h
@@ -172,9 +172,9 @@ namespace es2
bool getUniformuiv(GLint location, GLsizei *bufSize, GLuint *params);
void dirtyAllUniforms();
- void applyUniforms();
- void applyUniformBuffers(BufferBinding* uniformBuffers);
- void applyTransformFeedback(TransformFeedback* transformFeedback);
+ void applyUniforms(Device *device);
+ void applyUniformBuffers(Device *device, BufferBinding* uniformBuffers);
+ void applyTransformFeedback(Device *device, TransformFeedback* transformFeedback);
void link();
bool isLinked() const;
@@ -207,7 +207,7 @@ namespace es2
void flagForDeletion();
bool isFlaggedForDeletion() const;
- void validate();
+ void validate(Device* device);
bool validateSamplers(bool logErrors);
bool isValidated() const;
@@ -232,32 +232,32 @@ namespace es2
bool areMatchingUniformBlocks(const glsl::UniformBlock &block1, const glsl::UniformBlock &block2, const Shader *shader1, const Shader *shader2);
bool defineUniform(GLenum shader, GLenum type, GLenum precision, const std::string &_name, unsigned int arraySize, int registerIndex, const Uniform::BlockInfo& blockInfo);
bool defineUniformBlock(const Shader *shader, const glsl::UniformBlock &block);
- bool applyUniform(GLint location, float* data);
- bool applyUniform1bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform2bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform3bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform4bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform1fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniform2fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniform3fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniform4fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix2x3fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix2x4fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix3x2fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix3x4fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix4x2fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix4x3fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniform1iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform2iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform3iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform4iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform1uiv(GLint location, GLsizei count, const GLuint *v);
- bool applyUniform2uiv(GLint location, GLsizei count, const GLuint *v);
- bool applyUniform3uiv(GLint location, GLsizei count, const GLuint *v);
- bool applyUniform4uiv(GLint location, GLsizei count, const GLuint *v);
+ bool applyUniform(Device *device, GLint location, float* data);
+ bool applyUniform1bv(Device *device, GLint location, GLsizei count, const GLboolean *v);
+ bool applyUniform2bv(Device *device, GLint location, GLsizei count, const GLboolean *v);
+ bool applyUniform3bv(Device *device, GLint location, GLsizei count, const GLboolean *v);
+ bool applyUniform4bv(Device *device, GLint location, GLsizei count, const GLboolean *v);
+ bool applyUniform1fv(Device *device, GLint location, GLsizei count, const GLfloat *v);
+ bool applyUniform2fv(Device *device, GLint location, GLsizei count, const GLfloat *v);
+ bool applyUniform3fv(Device *device, GLint location, GLsizei count, const GLfloat *v);
+ bool applyUniform4fv(Device *device, GLint location, GLsizei count, const GLfloat *v);
+ bool applyUniformMatrix2fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix2x3fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix2x4fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix3fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix3x2fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix3x4fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix4fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix4x2fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniformMatrix4x3fv(Device *device, GLint location, GLsizei count, const GLfloat *value);
+ bool applyUniform1iv(Device *device, GLint location, GLsizei count, const GLint *v);
+ bool applyUniform2iv(Device *device, GLint location, GLsizei count, const GLint *v);
+ bool applyUniform3iv(Device *device, GLint location, GLsizei count, const GLint *v);
+ bool applyUniform4iv(Device *device, GLint location, GLsizei count, const GLint *v);
+ bool applyUniform1uiv(Device *device, GLint location, GLsizei count, const GLuint *v);
+ bool applyUniform2uiv(Device *device, GLint location, GLsizei count, const GLuint *v);
+ bool applyUniform3uiv(Device *device, GLint location, GLsizei count, const GLuint *v);
+ bool applyUniform4uiv(Device *device, GLint location, GLsizei count, const GLuint *v);
bool setUniformfv(GLint location, GLsizei count, const GLfloat *v, int numElements);
bool setUniformMatrixfv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value, GLenum type);
@@ -270,7 +270,6 @@ namespace es2
static unsigned int issueSerial();
private:
- es2::Device *device;
FragmentShader *fragmentShader;
VertexShader *vertexShader;
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.cpp
index 48bd3635048..bf83472bcb8 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.cpp
@@ -23,7 +23,7 @@
#include "Framebuffer.h"
#include "Device.hpp"
#include "libEGL/Display.h"
-#include "libEGL/EGLSurface.h"
+#include "common/Surface.hpp"
#include "common/debug.h"
#include <algorithm>
@@ -406,12 +406,12 @@ egl::Image *Texture::createSharedImage(GLenum target, unsigned int level)
return image;
}
-void Texture::setImage(GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image)
+void Texture::setImage(egl::Context *context, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image)
{
if(pixels && image)
{
GLsizei depth = (getTarget() == GL_TEXTURE_3D_OES || getTarget() == GL_TEXTURE_2D_ARRAY) ? image->getDepth() : 1;
- image->loadImageData(0, 0, 0, image->getWidth(), image->getHeight(), depth, format, type, unpackInfo, pixels);
+ image->loadImageData(context, 0, 0, 0, image->getWidth(), image->getHeight(), depth, format, type, unpackInfo, pixels);
}
}
@@ -424,7 +424,7 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, egl::Ima
}
}
-void Texture::subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image)
+void Texture::subImage(egl::Context *context, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image)
{
if(!image)
{
@@ -448,7 +448,7 @@ void Texture::subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei widt
if(pixels)
{
- image->loadImageData(xoffset, yoffset, zoffset, width, height, depth, format, type, unpackInfo, pixels);
+ image->loadImageData(context, xoffset, yoffset, zoffset, width, height, depth, format, type, unpackInfo, pixels);
}
}
@@ -633,24 +633,24 @@ int Texture2D::getLevelCount() const
return levels;
}
-void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
+void Texture2D::setImage(egl::Context *context, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
{
if(image[level])
{
image[level]->release();
}
- image[level] = new egl::Image(this, width, height, format, type);
+ image[level] = egl::Image::create(this, width, height, format, type);
if(!image[level])
{
return error(GL_OUT_OF_MEMORY);
}
- Texture::setImage(format, type, unpackInfo, pixels, image[level]);
+ Texture::setImage(context, format, type, unpackInfo, pixels, image[level]);
}
-void Texture2D::bindTexImage(egl::Surface *surface)
+void Texture2D::bindTexImage(gl::Surface *surface)
{
GLenum format;
@@ -708,7 +708,7 @@ void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- image[level] = new egl::Image(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
+ image[level] = egl::Image::create(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
if(!image[level])
{
@@ -718,9 +718,9 @@ void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
Texture::setCompressedImage(imageSize, pixels, image[level]);
}
-void Texture2D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
+void Texture2D::subImage(egl::Context *context, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
{
- Texture::subImage(xoffset, yoffset, 0, width, height, 1, format, type, unpackInfo, pixels, image[level]);
+ Texture::subImage(context, xoffset, yoffset, 0, width, height, 1, format, type, unpackInfo, pixels, image[level]);
}
void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
@@ -744,7 +744,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- image[level] = new egl::Image(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
+ image[level] = egl::Image::create(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
if(!image[level])
{
@@ -915,7 +915,7 @@ void Texture2D::generateMipmaps()
image[i]->release();
}
- image[i] = new egl::Image(this, std::max(image[0]->getWidth() >> i, 1), std::max(image[0]->getHeight() >> i, 1), image[0]->getFormat(), image[0]->getType());
+ image[i] = egl::Image::create(this, std::max(image[0]->getWidth() >> i, 1), std::max(image[0]->getHeight() >> i, 1), image[0]->getFormat(), image[0]->getType());
if(!image[i])
{
@@ -1137,7 +1137,7 @@ void TextureCubeMap::setCompressedImage(GLenum target, GLint level, GLenum forma
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- image[face][level] = new egl::Image(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
+ image[face][level] = egl::Image::create(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
if(!image[face][level])
{
@@ -1147,9 +1147,9 @@ void TextureCubeMap::setCompressedImage(GLenum target, GLint level, GLenum forma
Texture::setCompressedImage(imageSize, pixels, image[face][level]);
}
-void TextureCubeMap::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
+void TextureCubeMap::subImage(egl::Context *context, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
{
- Texture::subImage(xoffset, yoffset, 0, width, height, 1, format, type, unpackInfo, pixels, image[CubeFaceIndex(target)][level]);
+ Texture::subImage(context, xoffset, yoffset, 0, width, height, 1, format, type, unpackInfo, pixels, image[CubeFaceIndex(target)][level]);
}
void TextureCubeMap::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
@@ -1269,7 +1269,7 @@ void TextureCubeMap::releaseTexImage()
UNREACHABLE(0); // Cube maps cannot have an EGL surface bound as an image
}
-void TextureCubeMap::setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
+void TextureCubeMap::setImage(egl::Context *context, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
{
int face = CubeFaceIndex(target);
@@ -1278,14 +1278,14 @@ void TextureCubeMap::setImage(GLenum target, GLint level, GLsizei width, GLsizei
image[face][level]->release();
}
- image[face][level] = new egl::Image(this, width, height, format, type);
+ image[face][level] = egl::Image::create(this, width, height, format, type);
if(!image[face][level])
{
return error(GL_OUT_OF_MEMORY);
}
- Texture::setImage(format, type, unpackInfo, pixels, image[face][level]);
+ Texture::setImage(context, format, type, unpackInfo, pixels, image[face][level]);
}
void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
@@ -1306,7 +1306,7 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- image[face][level] = new egl::Image(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
+ image[face][level] = egl::Image::create(this, width, height, sizedInternalFormat, GL_UNSIGNED_BYTE);
if(!image[face][level])
{
@@ -1400,7 +1400,7 @@ void TextureCubeMap::generateMipmaps()
image[f][i]->release();
}
- image[f][i] = new egl::Image(this, std::max(image[0][0]->getWidth() >> i, 1), std::max(image[0][0]->getHeight() >> i, 1), image[0][0]->getFormat(), image[0][0]->getType());
+ image[f][i] = egl::Image::create(this, std::max(image[0][0]->getWidth() >> i, 1), std::max(image[0][0]->getHeight() >> i, 1), image[0][0]->getFormat(), image[0][0]->getType());
if(!image[f][i])
{
@@ -1594,65 +1594,26 @@ int Texture3D::getLevelCount() const
return levels;
}
-void Texture3D::setImage(GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
+void Texture3D::setImage(egl::Context *context, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
{
if(image[level])
{
image[level]->release();
}
- image[level] = new egl::Image(this, width, height, depth, format, type);
+ image[level] = egl::Image::create(this, width, height, depth, format, type);
if(!image[level])
{
return error(GL_OUT_OF_MEMORY);
}
- Texture::setImage(format, type, unpackInfo, pixels, image[level]);
-}
-
-void Texture3D::bindTexImage(egl::Surface *surface)
-{
- GLenum format;
-
- switch(surface->getInternalFormat())
- {
- case sw::FORMAT_A8R8G8B8:
- format = GL_RGBA;
- break;
- case sw::FORMAT_X8R8G8B8:
- format = GL_RGB;
- break;
- default:
- UNIMPLEMENTED();
- return;
- }
-
- for(int level = 0; level < IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
- {
- if(image[level])
- {
- image[level]->release();
- image[level] = nullptr;
- }
- }
-
- image[0] = surface->getRenderTarget();
-
- mSurface = surface;
- mSurface->setBoundTexture(this);
+ Texture::setImage(context, format, type, unpackInfo, pixels, image[level]);
}
void Texture3D::releaseTexImage()
{
- for(int level = 0; level < IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
- {
- if(image[level])
- {
- image[level]->release();
- image[level] = nullptr;
- }
- }
+ UNREACHABLE(0); // 3D textures cannot have an EGL surface bound as an image
}
void Texture3D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
@@ -1663,7 +1624,7 @@ void Texture3D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- image[level] = new egl::Image(this, width, height, depth, sizedInternalFormat, GL_UNSIGNED_BYTE);
+ image[level] = egl::Image::create(this, width, height, depth, sizedInternalFormat, GL_UNSIGNED_BYTE);
if(!image[level])
{
@@ -1673,9 +1634,9 @@ void Texture3D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
Texture::setCompressedImage(imageSize, pixels, image[level]);
}
-void Texture3D::subImage(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
+void Texture3D::subImage(egl::Context *context, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels)
{
- Texture::subImage(xoffset, yoffset, zoffset, width, height, depth, format, type, unpackInfo, pixels, image[level]);
+ Texture::subImage(context, xoffset, yoffset, zoffset, width, height, depth, format, type, unpackInfo, pixels, image[level]);
}
void Texture3D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
@@ -1699,7 +1660,7 @@ void Texture3D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLint z,
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- image[level] = new egl::Image(this, width, height, depth, sizedInternalFormat, GL_UNSIGNED_BYTE);
+ image[level] = egl::Image::create(this, width, height, depth, sizedInternalFormat, GL_UNSIGNED_BYTE);
if(!image[level])
{
@@ -1877,7 +1838,7 @@ void Texture3D::generateMipmaps()
image[i]->release();
}
- image[i] = new egl::Image(this, std::max(image[0]->getWidth() >> i, 1), std::max(image[0]->getHeight() >> i, 1), std::max(image[0]->getDepth() >> i, 1), image[0]->getFormat(), image[0]->getType());
+ image[i] = egl::Image::create(this, std::max(image[0]->getWidth() >> i, 1), std::max(image[0]->getHeight() >> i, 1), std::max(image[0]->getDepth() >> i, 1), image[0]->getFormat(), image[0]->getType());
if(!image[i])
{
@@ -1976,7 +1937,7 @@ void Texture2DArray::generateMipmaps()
GLsizei w = std::max(image[0]->getWidth() >> i, 1);
GLsizei h = std::max(image[0]->getHeight() >> i, 1);
- image[i] = new egl::Image(this, w, h, depth, image[0]->getFormat(), image[0]->getType());
+ image[i] = egl::Image::create(this, w, h, depth, image[0]->getFormat(), image[0]->getType());
if(!image[i])
{
@@ -2014,19 +1975,20 @@ GLenum TextureExternal::getTarget() const
}
-egl::Image *createBackBuffer(int width, int height, const egl::Config *config)
+egl::Image *createBackBuffer(int width, int height, sw::Format format, int multiSampleDepth)
{
- if(config)
+ if(width > es2::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE || height > es2::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE)
{
- return new egl::Image(width, height, config->mRenderTargetFormat, config->mSamples, false);
+ ERR("Invalid parameters: %dx%d", width, height);
+ return nullptr;
}
- return nullptr;
+ return egl::Image::create(width, height, format, multiSampleDepth, false);
}
-egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
+egl::Image *createDepthStencil(int width, int height, sw::Format format, int multiSampleDepth)
{
- if(width == 0 || height == 0 || height > sw::OUTLINE_RESOLUTION)
+ if(width > es2::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE || height > es2::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE)
{
ERR("Invalid parameters: %dx%d", width, height);
return nullptr;
@@ -2057,7 +2019,7 @@ egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Form
UNREACHABLE(format);
}
- egl::Image *surface = new egl::Image(width, height, format, multiSampleDepth, lockable);
+ egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface)
{
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.h b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.h
index a97f168c999..143c51e65bc 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.h
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/Texture.h
@@ -29,11 +29,7 @@
#include <vector>
-namespace egl
-{
-class Surface;
-class Config;
-}
+namespace gl { class Surface; }
namespace es2
{
@@ -52,7 +48,7 @@ class Texture : public egl::Texture
public:
explicit Texture(GLuint name);
- virtual sw::Resource *getResource() const;
+ sw::Resource *getResource() const override;
virtual void addProxyRef(const Renderbuffer *proxy) = 0;
virtual void releaseProxy(const Renderbuffer *proxy) = 0;
@@ -110,17 +106,17 @@ public:
virtual Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer) = 0;
virtual egl::Image *getRenderTarget(GLenum target, unsigned int level) = 0;
- virtual egl::Image *createSharedImage(GLenum target, unsigned int level);
+ egl::Image *createSharedImage(GLenum target, unsigned int level);
virtual bool isShared(GLenum target, unsigned int level) const = 0;
virtual void generateMipmaps() = 0;
virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) = 0;
protected:
- virtual ~Texture();
+ ~Texture() override;
- void setImage(GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image);
- void subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image);
+ void setImage(egl::Context *context, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image);
+ void subImage(egl::Context *context, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels, egl::Image *image);
void setCompressedImage(GLsizei imageSize, const void *pixels, egl::Image *image);
void subImageCompressed(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels, egl::Image *image);
@@ -159,46 +155,46 @@ public:
void releaseProxy(const Renderbuffer *proxy) override;
void sweep() override;
- virtual GLenum getTarget() const;
+ GLenum getTarget() const override;
- virtual GLsizei getWidth(GLenum target, GLint level) const;
- virtual GLsizei getHeight(GLenum target, GLint level) const;
- virtual GLenum getFormat(GLenum target, GLint level) const;
- virtual GLenum getType(GLenum target, GLint level) const;
- virtual sw::Format getInternalFormat(GLenum target, GLint level) const;
- virtual int getLevelCount() const;
+ GLsizei getWidth(GLenum target, GLint level) const override;
+ GLsizei getHeight(GLenum target, GLint level) const override;
+ GLenum getFormat(GLenum target, GLint level) const override;
+ GLenum getType(GLenum target, GLint level) const override;
+ sw::Format getInternalFormat(GLenum target, GLint level) const override;
+ int getLevelCount() const override;
- void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
+ void setImage(egl::Context *context, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
- void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
+ void subImage(egl::Context *context, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
- virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
+ void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) override;
void setSharedImage(egl::Image *image);
- virtual bool isSamplerComplete() const;
- virtual bool isCompressed(GLenum target, GLint level) const;
- virtual bool isDepth(GLenum target, GLint level) const;
- virtual void bindTexImage(egl::Surface *surface);
- virtual void releaseTexImage();
+ bool isSamplerComplete() const override;
+ bool isCompressed(GLenum target, GLint level) const override;
+ bool isDepth(GLenum target, GLint level) const override;
+ void bindTexImage(gl::Surface *surface);
+ void releaseTexImage() override;
- virtual void generateMipmaps();
+ void generateMipmaps() override;
- virtual Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer);
- virtual egl::Image *getRenderTarget(GLenum target, unsigned int level);
- virtual bool isShared(GLenum target, unsigned int level) const;
+ Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer) override;
+ egl::Image *getRenderTarget(GLenum target, unsigned int level) override;
+ bool isShared(GLenum target, unsigned int level) const override;
egl::Image *getImage(unsigned int level);
protected:
- virtual ~Texture2D();
+ ~Texture2D() override;
bool isMipmapComplete() const;
egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
- egl::Surface *mSurface;
+ gl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer
@@ -218,38 +214,38 @@ public:
void releaseProxy(const Renderbuffer *proxy) override;
void sweep() override;
- virtual GLenum getTarget() const;
+ GLenum getTarget() const override;
- virtual GLsizei getWidth(GLenum target, GLint level) const;
- virtual GLsizei getHeight(GLenum target, GLint level) const;
- virtual GLenum getFormat(GLenum target, GLint level) const;
- virtual GLenum getType(GLenum target, GLint level) const;
- virtual sw::Format getInternalFormat(GLenum target, GLint level) const;
- virtual int getLevelCount() const;
+ GLsizei getWidth(GLenum target, GLint level) const override;
+ GLsizei getHeight(GLenum target, GLint level) const override;
+ GLenum getFormat(GLenum target, GLint level) const override;
+ GLenum getType(GLenum target, GLint level) const override;
+ sw::Format getInternalFormat(GLenum target, GLint level) const override;
+ int getLevelCount() const override;
- void setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
+ void setImage(egl::Context *context, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
void setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
- void subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
+ void subImage(egl::Context *context, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
void subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
- virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
+ void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) override;
- virtual bool isSamplerComplete() const;
- virtual bool isCompressed(GLenum target, GLint level) const;
- virtual bool isDepth(GLenum target, GLint level) const;
- virtual void releaseTexImage();
+ bool isSamplerComplete() const override;
+ bool isCompressed(GLenum target, GLint level) const override;
+ bool isDepth(GLenum target, GLint level) const override;
+ void releaseTexImage() override;
- virtual void generateMipmaps();
+ void generateMipmaps() override;
- virtual Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer);
- virtual egl::Image *getRenderTarget(GLenum target, unsigned int level);
- virtual bool isShared(GLenum target, unsigned int level) const;
+ Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer) override;
+ egl::Image *getRenderTarget(GLenum target, unsigned int level) override;
+ bool isShared(GLenum target, unsigned int level) const override;
egl::Image *getImage(int face, unsigned int level);
protected:
- virtual ~TextureCubeMap();
+ ~TextureCubeMap() override;
private:
bool isCubeComplete() const;
@@ -278,47 +274,46 @@ public:
void releaseProxy(const Renderbuffer *proxy) override;
void sweep() override;
- virtual GLenum getTarget() const;
+ GLenum getTarget() const override;
- virtual GLsizei getWidth(GLenum target, GLint level) const;
- virtual GLsizei getHeight(GLenum target, GLint level) const;
- virtual GLsizei getDepth(GLenum target, GLint level) const;
- virtual GLenum getFormat(GLenum target, GLint level) const;
- virtual GLenum getType(GLenum target, GLint level) const;
- virtual sw::Format getInternalFormat(GLenum target, GLint level) const;
- virtual int getLevelCount() const;
+ GLsizei getWidth(GLenum target, GLint level) const override;
+ GLsizei getHeight(GLenum target, GLint level) const override;
+ GLsizei getDepth(GLenum target, GLint level) const override;
+ GLenum getFormat(GLenum target, GLint level) const override;
+ GLenum getType(GLenum target, GLint level) const override;
+ sw::Format getInternalFormat(GLenum target, GLint level) const override;
+ int getLevelCount() const override;
- void setImage(GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
+ void setImage(egl::Context *context, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels);
- void subImage(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
+ void subImage(egl::Context *context, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const egl::Image::UnpackInfo& unpackInfo, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLint level, GLenum format, GLint x, GLint y, GLint z, GLsizei width, GLsizei height, GLsizei depth, Framebuffer *source);
void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void setSharedImage(egl::Image *image);
- virtual bool isSamplerComplete() const;
- virtual bool isCompressed(GLenum target, GLint level) const;
- virtual bool isDepth(GLenum target, GLint level) const;
- virtual void bindTexImage(egl::Surface *surface);
- virtual void releaseTexImage();
+ bool isSamplerComplete() const override;
+ bool isCompressed(GLenum target, GLint level) const override;
+ bool isDepth(GLenum target, GLint level) const override;
+ void releaseTexImage() override;
- virtual void generateMipmaps();
+ void generateMipmaps() override;
- virtual Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer);
- virtual egl::Image *getRenderTarget(GLenum target, unsigned int level);
- virtual bool isShared(GLenum target, unsigned int level) const;
+ Renderbuffer *getRenderbuffer(GLenum target, GLint level, GLint layer) override;
+ egl::Image *getRenderTarget(GLenum target, unsigned int level) override;
+ bool isShared(GLenum target, unsigned int level) const override;
egl::Image *getImage(unsigned int level);
protected:
- virtual ~Texture3D();
+ ~Texture3D() override;
bool isMipmapComplete() const;
egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
- egl::Surface *mSurface;
+ gl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer
@@ -334,11 +329,11 @@ class Texture2DArray : public Texture3D
public:
explicit Texture2DArray(GLuint name);
- virtual GLenum getTarget() const;
- virtual void generateMipmaps();
+ GLenum getTarget() const override;
+ void generateMipmaps() override;
protected:
- virtual ~Texture2DArray();
+ ~Texture2DArray() override;
};
class TextureExternal : public Texture2D
@@ -346,10 +341,10 @@ class TextureExternal : public Texture2D
public:
explicit TextureExternal(GLuint name);
- virtual GLenum getTarget() const;
+ GLenum getTarget() const override;
protected:
- virtual ~TextureExternal();
+ ~TextureExternal() override;
};
}
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/TypeInfo.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/TypeInfo.cpp
deleted file mode 100644
index 8fb91d34964..00000000000
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/TypeInfo.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 The SwiftShader Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "libEGL/Display.h"
-#include "libEGL/EGLSurface.h"
-
-namespace egl
-{
-void Surface::typeinfo() {}
-void Display::typeinfo() {}
-}
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/VertexDataManager.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/VertexDataManager.cpp
index 7b5cc6f3e76..2fff628c5eb 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/VertexDataManager.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/VertexDataManager.cpp
@@ -153,7 +153,7 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
Buffer *buffer = attrib.mBoundBuffer;
- if(!buffer && attrib.mPointer == nullptr)
+ if((!buffer && attrib.mPointer == nullptr) || (buffer && !buffer->data()))
{
// This is an application error that would normally result in a crash, but we catch it and return an error
ERR("An enabled vertex array has no buffer and no pointer.");
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/exports.map b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/exports.map
index 82385648ecd..adc4ff58d4a 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/exports.map
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/exports.map
@@ -1,172 +1,279 @@
{
global:
- glActiveTexture;
- glAttachShader;
- glBindAttribLocation;
- glBindBuffer;
- glBindFramebuffer;
- glBindRenderbuffer;
- glBindTexture;
- glBlendColor;
- glBlendEquation;
- glBlendEquationSeparate;
- glBlendFunc;
- glBlendFuncSeparate;
- glBufferData;
- glBufferSubData;
- glCheckFramebufferStatus;
- glClear;
- glClearColor;
- glClearDepthf;
- glClearStencil;
- glColorMask;
- glCompileShader;
- glCompressedTexImage2D;
- glCompressedTexSubImage2D;
- glCopyTexImage2D;
- glCopyTexSubImage2D;
- glCreateProgram;
- glCreateShader;
- glCullFace;
- glDeleteBuffers;
- glDeleteFramebuffers;
- glDeleteProgram;
- glDeleteRenderbuffers;
- glDeleteShader;
- glDeleteTextures;
- glDepthFunc;
- glDepthMask;
- glDepthRangef;
- glDetachShader;
- glDisable;
- glDisableVertexAttribArray;
- glDrawArrays;
- glDrawElements;
- glEnable;
- glEnableVertexAttribArray;
- glFinish;
- glFlush;
- glFramebufferRenderbuffer;
- glFramebufferTexture2D;
- glFrontFace;
- glGenBuffers;
- glGenFramebuffers;
- glGenRenderbuffers;
- glGenTextures;
- glGenerateMipmap;
- glGetActiveAttrib;
- glGetActiveUniform;
- glGetAttachedShaders;
- glGetAttribLocation;
- glGetBooleanv;
- glGetBufferParameteriv;
- glGetError;
- glGetFloatv;
- glGetFramebufferAttachmentParameteriv;
- glGetIntegerv;
- glGetProgramInfoLog;
- glGetProgramiv;
- glGetRenderbufferParameteriv;
- glGetShaderInfoLog;
- glGetShaderPrecisionFormat;
- glGetShaderSource;
- glGetShaderiv;
- glGetString;
- glGetTexParameterfv;
- glGetTexParameteriv;
- glGetUniformLocation;
- glGetUniformfv;
- glGetUniformiv;
- glGetVertexAttribPointerv;
- glGetVertexAttribfv;
- glGetVertexAttribiv;
- glHint;
- glIsBuffer;
- glIsEnabled;
- glIsFramebuffer;
- glIsProgram;
- glIsRenderbuffer;
- glIsShader;
- glIsTexture;
- glLineWidth;
- glLinkProgram;
- glPixelStorei;
- glPolygonOffset;
- glReadPixels;
- glReleaseShaderCompiler;
- glRenderbufferStorage;
- glSampleCoverage;
- glScissor;
- glShaderBinary;
- glShaderSource;
- glStencilFunc;
- glStencilFuncSeparate;
- glStencilMask;
- glStencilMaskSeparate;
- glStencilOp;
- glStencilOpSeparate;
- glTexImage2D;
- glTexParameterf;
- glTexParameterfv;
- glTexParameteri;
- glTexParameteriv;
- glTexSubImage2D;
- glUniform1f;
- glUniform1fv;
- glUniform1i;
- glUniform1iv;
- glUniform2f;
- glUniform2fv;
- glUniform2i;
- glUniform2iv;
- glUniform3f;
- glUniform3fv;
- glUniform3i;
- glUniform3iv;
- glUniform4f;
- glUniform4fv;
- glUniform4i;
- glUniform4iv;
- glUniformMatrix2fv;
- glUniformMatrix3fv;
- glUniformMatrix4fv;
- glUseProgram;
- glValidateProgram;
- glVertexAttrib1f;
- glVertexAttrib1fv;
- glVertexAttrib2f;
- glVertexAttrib2fv;
- glVertexAttrib3f;
- glVertexAttrib3fv;
- glVertexAttrib4f;
- glVertexAttrib4fv;
- glVertexAttribPointer;
- glViewport;
+ # OpenGL ES 2.0 core functions
+ glActiveTexture;
+ glAttachShader;
+ glBindAttribLocation;
+ glBindBuffer;
+ glBindFramebuffer;
+ glBindRenderbuffer;
+ glBindTexture;
+ glBlendColor;
+ glBlendEquation;
+ glBlendEquationSeparate;
+ glBlendFunc;
+ glBlendFuncSeparate;
+ glBufferData;
+ glBufferSubData;
+ glCheckFramebufferStatus;
+ glClear;
+ glClearColor;
+ glClearDepthf;
+ glClearStencil;
+ glColorMask;
+ glCompileShader;
+ glCompressedTexImage2D;
+ glCompressedTexSubImage2D;
+ glCopyTexImage2D;
+ glCopyTexSubImage2D;
+ glCreateProgram;
+ glCreateShader;
+ glCullFace;
+ glDeleteBuffers;
+ glDeleteFramebuffers;
+ glDeleteProgram;
+ glDeleteRenderbuffers;
+ glDeleteShader;
+ glDeleteTextures;
+ glDepthFunc;
+ glDepthMask;
+ glDepthRangef;
+ glDetachShader;
+ glDisable;
+ glDisableVertexAttribArray;
+ glDrawArrays;
+ glDrawElements;
+ glEnable;
+ glEnableVertexAttribArray;
+ glFinish;
+ glFlush;
+ glFramebufferRenderbuffer;
+ glFramebufferTexture2D;
+ glFrontFace;
+ glGenBuffers;
+ glGenFramebuffers;
+ glGenRenderbuffers;
+ glGenTextures;
+ glGenerateMipmap;
+ glGetActiveAttrib;
+ glGetActiveUniform;
+ glGetAttachedShaders;
+ glGetAttribLocation;
+ glGetBooleanv;
+ glGetBufferParameteriv;
+ glGetError;
+ glGetFloatv;
+ glGetFramebufferAttachmentParameteriv;
+ glGetIntegerv;
+ glGetProgramInfoLog;
+ glGetProgramiv;
+ glGetRenderbufferParameteriv;
+ glGetShaderInfoLog;
+ glGetShaderPrecisionFormat;
+ glGetShaderSource;
+ glGetShaderiv;
+ glGetString;
+ glGetTexParameterfv;
+ glGetTexParameteriv;
+ glGetUniformLocation;
+ glGetUniformfv;
+ glGetUniformiv;
+ glGetVertexAttribPointerv;
+ glGetVertexAttribfv;
+ glGetVertexAttribiv;
+ glHint;
+ glIsBuffer;
+ glIsEnabled;
+ glIsFramebuffer;
+ glIsProgram;
+ glIsRenderbuffer;
+ glIsShader;
+ glIsTexture;
+ glLineWidth;
+ glLinkProgram;
+ glPixelStorei;
+ glPolygonOffset;
+ glReadPixels;
+ glReleaseShaderCompiler;
+ glRenderbufferStorage;
+ glSampleCoverage;
+ glScissor;
+ glShaderBinary;
+ glShaderSource;
+ glStencilFunc;
+ glStencilFuncSeparate;
+ glStencilMask;
+ glStencilMaskSeparate;
+ glStencilOp;
+ glStencilOpSeparate;
+ glTexImage2D;
+ glTexParameterf;
+ glTexParameterfv;
+ glTexParameteri;
+ glTexParameteriv;
+ glTexSubImage2D;
+ glUniform1f;
+ glUniform1fv;
+ glUniform1i;
+ glUniform1iv;
+ glUniform2f;
+ glUniform2fv;
+ glUniform2i;
+ glUniform2iv;
+ glUniform3f;
+ glUniform3fv;
+ glUniform3i;
+ glUniform3iv;
+ glUniform4f;
+ glUniform4fv;
+ glUniform4i;
+ glUniform4iv;
+ glUniformMatrix2fv;
+ glUniformMatrix3fv;
+ glUniformMatrix4fv;
+ glUseProgram;
+ glValidateProgram;
+ glVertexAttrib1f;
+ glVertexAttrib1fv;
+ glVertexAttrib2f;
+ glVertexAttrib2fv;
+ glVertexAttrib3f;
+ glVertexAttrib3fv;
+ glVertexAttrib4f;
+ glVertexAttrib4fv;
+ glVertexAttribPointer;
+ glViewport;
- # Extensions
- glTexImage3DOES;
- glBlitFramebufferANGLE;
- glRenderbufferStorageMultisampleANGLE;
- glDeleteFencesNV;
- glFinishFenceNV;
- glGenFencesNV;
- glGetFenceivNV;
- glIsFenceNV;
- glSetFenceNV;
- glTestFenceNV;
- glGetGraphicsResetStatusEXT;
- glReadnPixelsEXT;
- glGetnUniformfvEXT;
- glGetnUniformivEXT;
- glGenQueriesEXT;
- glDeleteQueriesEXT;
- glIsQueryEXT;
- glBeginQueryEXT;
- glEndQueryEXT;
- glGetQueryivEXT;
- glGetQueryObjectuivEXT;
- glEGLImageTargetTexture2DOES;
- glEGLImageTargetRenderbufferStorageOES;
+ # OpenGL ES 3.0 core functions
+ glReadBuffer;
+ glDrawRangeElements;
+ glTexImage3D;
+ glTexSubImage3D;
+ glCopyTexSubImage3D;
+ glCompressedTexImage3D;
+ glCompressedTexSubImage3D;
+ glGenQueries;
+ glDeleteQueries;
+ glIsQuery;
+ glBeginQuery;
+ glEndQuery;
+ glGetQueryiv;
+ glGetQueryObjectuiv;
+ glUnmapBuffer;
+ glGetBufferPointerv;
+ glDrawBuffers;
+ glUniformMatrix2x3fv;
+ glUniformMatrix3x2fv;
+ glUniformMatrix2x4fv;
+ glUniformMatrix4x2fv;
+ glUniformMatrix3x4fv;
+ glUniformMatrix4x3fv;
+ glBlitFramebuffer;
+ glRenderbufferStorageMultisample;
+ glFramebufferTextureLayer;
+ glMapBufferRange;
+ glFlushMappedBufferRange;
+ glBindVertexArray;
+ glDeleteVertexArrays;
+ glGenVertexArrays;
+ glIsVertexArray;
+ glGetIntegeri_v;
+ glBeginTransformFeedback;
+ glEndTransformFeedback;
+ glBindBufferRange;
+ glBindBufferBase;
+ glTransformFeedbackVaryings;
+ glGetTransformFeedbackVarying;
+ glVertexAttribIPointer;
+ glGetVertexAttribIiv;
+ glGetVertexAttribIuiv;
+ glVertexAttribI4i;
+ glVertexAttribI4ui;
+ glVertexAttribI4iv;
+ glVertexAttribI4uiv;
+ glGetUniformuiv;
+ glGetFragDataLocation;
+ glUniform1ui;
+ glUniform2ui;
+ glUniform3ui;
+ glUniform4ui;
+ glUniform1uiv;
+ glUniform2uiv;
+ glUniform3uiv;
+ glUniform4uiv;
+ glClearBufferiv;
+ glClearBufferuiv;
+ glClearBufferfv;
+ glClearBufferfi;
+ glGetStringi;
+ glCopyBufferSubData;
+ glGetUniformIndices;
+ glGetActiveUniformsiv;
+ glGetUniformBlockIndex;
+ glGetActiveUniformBlockiv;
+ glGetActiveUniformBlockName;
+ glUniformBlockBinding;
+ glDrawArraysInstanced;
+ glDrawElementsInstanced;
+ glFenceSync;
+ glIsSync;
+ glDeleteSync;
+ glClientWaitSync;
+ glWaitSync;
+ glGetInteger64v;
+ glGetSynciv;
+ glGetInteger64i_v;
+ glGetBufferParameteri64v;
+ glGenSamplers;
+ glDeleteSamplers;
+ glIsSampler;
+ glBindSampler;
+ glSamplerParameteri;
+ glSamplerParameteriv;
+ glSamplerParameterf;
+ glSamplerParameterfv;
+ glGetSamplerParameteriv;
+ glGetSamplerParameterfv;
+ glVertexAttribDivisor;
+ glBindTransformFeedback;
+ glDeleteTransformFeedbacks;
+ glGenTransformFeedbacks;
+ glIsTransformFeedback;
+ glPauseTransformFeedback;
+ glResumeTransformFeedback;
+ glGetProgramBinary;
+ glProgramBinary;
+ glProgramParameteri;
+ glInvalidateFramebuffer;
+ glInvalidateSubFramebuffer;
+ glTexStorage2D;
+ glTexStorage3D;
+ glGetInternalformativ;
+
+ # Extensions
+ glTexImage3DOES;
+ glBlitFramebufferANGLE;
+ glRenderbufferStorageMultisampleANGLE;
+ glDeleteFencesNV;
+ glFinishFenceNV;
+ glGenFencesNV;
+ glGetFenceivNV;
+ glIsFenceNV;
+ glSetFenceNV;
+ glTestFenceNV;
+ glGetGraphicsResetStatusEXT;
+ glReadnPixelsEXT;
+ glGetnUniformfvEXT;
+ glGetnUniformivEXT;
+ glGenQueriesEXT;
+ glDeleteQueriesEXT;
+ glIsQueryEXT;
+ glBeginQueryEXT;
+ glEndQueryEXT;
+ glGetQueryivEXT;
+ glGetQueryObjectuivEXT;
+ glEGLImageTargetTexture2DOES;
+ glEGLImageTargetRenderbufferStorageOES;
glIsRenderbufferOES;
glBindRenderbufferOES;
glDeleteRenderbuffersOES;
@@ -184,117 +291,15 @@ global:
glGenerateMipmapOES;
glDrawBuffersEXT;
- # GLES 3.0 Functions
- glReadBuffer;
- glDrawRangeElements;
- glTexImage3D;
- glTexSubImage3D;
- glCopyTexSubImage3D;
- glCompressedTexImage3D;
- glCompressedTexSubImage3D;
- glGenQueries;
- glDeleteQueries;
- glIsQuery;
- glBeginQuery;
- glEndQuery;
- glGetQueryiv;
- glGetQueryObjectuiv;
- glUnmapBuffer;
- glGetBufferPointerv;
- glDrawBuffers;
- glUniformMatrix2x3fv;
- glUniformMatrix3x2fv;
- glUniformMatrix2x4fv;
- glUniformMatrix4x2fv;
- glUniformMatrix3x4fv;
- glUniformMatrix4x3fv;
- glBlitFramebuffer;
- glRenderbufferStorageMultisample;
- glFramebufferTextureLayer;
- glMapBufferRange;
- glFlushMappedBufferRange;
- glBindVertexArray;
- glDeleteVertexArrays;
- glGenVertexArrays;
- glIsVertexArray;
- glGetIntegeri_v;
- glBeginTransformFeedback;
- glEndTransformFeedback;
- glBindBufferRange;
- glBindBufferBase;
- glTransformFeedbackVaryings;
- glGetTransformFeedbackVarying;
- glVertexAttribIPointer;
- glGetVertexAttribIiv;
- glGetVertexAttribIuiv;
- glVertexAttribI4i;
- glVertexAttribI4ui;
- glVertexAttribI4iv;
- glVertexAttribI4uiv;
- glGetUniformuiv;
- glGetFragDataLocation;
- glUniform1ui;
- glUniform2ui;
- glUniform3ui;
- glUniform4ui;
- glUniform1uiv;
- glUniform2uiv;
- glUniform3uiv;
- glUniform4uiv;
- glClearBufferiv;
- glClearBufferuiv;
- glClearBufferfv;
- glClearBufferfi;
- glGetStringi;
- glCopyBufferSubData;
- glGetUniformIndices;
- glGetActiveUniformsiv;
- glGetUniformBlockIndex;
- glGetActiveUniformBlockiv;
- glGetActiveUniformBlockName;
- glUniformBlockBinding;
- glDrawArraysInstanced;
- glDrawElementsInstanced;
- glFenceSync;
- glIsSync;
- glDeleteSync;
- glClientWaitSync;
- glWaitSync;
- glGetInteger64v;
- glGetSynciv;
- glGetInteger64i_v;
- glGetBufferParameteri64v;
- glGenSamplers;
- glDeleteSamplers;
- glIsSampler;
- glBindSampler;
- glSamplerParameteri;
- glSamplerParameteriv;
- glSamplerParameterf;
- glSamplerParameterfv;
- glGetSamplerParameteriv;
- glGetSamplerParameterfv;
- glVertexAttribDivisor;
- glBindTransformFeedback;
- glDeleteTransformFeedbacks;
- glGenTransformFeedbacks;
- glIsTransformFeedback;
- glPauseTransformFeedback;
- glResumeTransformFeedback;
- glGetProgramBinary;
- glProgramBinary;
- glProgramParameteri;
- glInvalidateFramebuffer;
- glInvalidateSubFramebuffer;
- glTexStorage2D;
- glTexStorage3D;
- glGetInternalformativ;
+ # Table of function pointers to disambiguate between libraries
+ libGLESv2_swiftshader;
- libGLESv2_swiftshader;
+ # Type-strings and type-infos required by sanitizers
+ _ZTS*;
+ _ZTI*;
- Register;
+ Register;
local:
- *;
+ *;
};
-
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.cpp
index 172a6453c8f..dfe595910d7 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.cpp
@@ -4247,6 +4247,9 @@ void Hint(GLenum target, GLenum mode)
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
if(context) context->setFragmentShaderDerivativeHint(mode);
break;
+ case GL_TEXTURE_FILTERING_HINT_CHROMIUM:
+ if(context) context->setTextureFilteringHint(mode);
+ break;
default:
return error(GL_INVALID_ENUM);
}
@@ -5103,7 +5106,7 @@ void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width,
return error(GL_INVALID_OPERATION);
}
- texture->setImage(level, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
+ texture->setImage(context, level, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
}
else
{
@@ -5114,7 +5117,7 @@ void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width,
return error(GL_INVALID_OPERATION);
}
- texture->setImage(target, level, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
+ texture->setImage(context, target, level, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
}
}
}
@@ -5469,7 +5472,7 @@ void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLs
if(validationError == GL_NONE)
{
- texture->subImage(level, xoffset, yoffset, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
+ texture->subImage(context, level, xoffset, yoffset, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
}
else
{
@@ -5484,7 +5487,7 @@ void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLs
if(validationError == GL_NONE)
{
- texture->subImage(target, level, xoffset, yoffset, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
+ texture->subImage(context, target, level, xoffset, yoffset, width, height, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
}
else
{
@@ -5970,7 +5973,7 @@ void ValidateProgram(GLuint program)
}
}
- programObject->validate();
+ programObject->validate(context->getDevice());
}
}
@@ -6304,7 +6307,7 @@ void TexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei wi
return error(GL_INVALID_OPERATION);
}
- texture->setImage(level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), context->getPixels(data));
+ texture->setImage(context, level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), context->getPixels(data));
}
}
@@ -6349,7 +6352,7 @@ void TexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum validationError = ValidateSubImageParams(false, width, height, depth, xoffset, yoffset, zoffset, target, level, sizedInternalFormat, texture);
if(validationError == GL_NONE)
{
- texture->subImage(level, xoffset, yoffset, zoffset, width, height, depth, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
+ texture->subImage(context, level, xoffset, yoffset, zoffset, width, height, depth, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
}
else
{
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp
index 0b9e1350d30..42febd8a8d3 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp
@@ -244,8 +244,8 @@ public:
egl::Context *(*es2CreateContext)(egl::Display *display, const egl::Context *shareContext, int clientVersion, const egl::Config *config);
__eglMustCastToProperFunctionPointerType (*es2GetProcAddress)(const char *procname);
- egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
- egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
+ egl::Image *(*createBackBuffer)(int width, int height, sw::Format format, int multiSampleDepth);
+ egl::Image *(*createDepthStencil)(int width, int height, sw::Format format, int multiSampleDepth);
sw::FrameBuffer *(*createFrameBuffer)(void *nativeDisplay, EGLNativeWindowType window, int width, int height);
};
@@ -298,9 +298,9 @@ private:
#endif
#elif defined(__APPLE__)
#if defined(__LP64__)
- const char *libGLESv2_lib[] = {"lib64GLES_V2_translator.dylib", "libGLESv2.dylib"};
+ const char *libGLESv2_lib[] = {"lib64GLES_V2_translator.dylib", "libGLESv2.dylib", "libswiftshader_libGLESv2.dylib"};
#else
- const char *libGLESv2_lib[] = {"libGLES_V2_translator.dylib", "libGLESv2.dylib"};
+ const char *libGLESv2_lib[] = {"libGLES_V2_translator.dylib", "libGLESv2.dylib", "libswiftshader_libGLESv2.dylib"};
#endif
#else
#error "libGLESv2::loadExports unimplemented for this platform"
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj
index a4af6f128a2..fcf2f094e5c 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj
@@ -365,6 +365,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr
<ClInclude Include="..\common\Image.hpp" />
<ClInclude Include="..\common\NameSpace.hpp" />
<ClInclude Include="..\common\Object.hpp" />
+ <ClInclude Include="..\common\Surface.hpp" />
<ClInclude Include="..\include\GLES2\gl2.h" />
<ClInclude Include="..\include\GLES2\gl2ext.h" />
<ClInclude Include="..\include\GLES2\gl2platform.h" />
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj.filters b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj.filters
index b207dd68316..c3babbbe52f 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj.filters
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.vcxproj.filters
@@ -163,6 +163,9 @@
<ClInclude Include="..\common\Image.hpp">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\common\Surface.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="libGLESv2.rc" />
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv3.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv3.cpp
index be814f36983..642e5bbc532 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv3.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv3.cpp
@@ -492,6 +492,7 @@ static bool ValidateSamplerObjectParameter(GLenum pname)
case GL_TEXTURE_MAX_LOD:
case GL_TEXTURE_COMPARE_MODE:
case GL_TEXTURE_COMPARE_FUNC:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
return true;
default:
return false;
@@ -676,7 +677,7 @@ GL_APICALL void GL_APIENTRY glTexImage3D(GLenum target, GLint level, GLint inter
return error(GL_INVALID_OPERATION);
}
- texture->setImage(level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), context->getPixels(data));
+ texture->setImage(context, level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), context->getPixels(data));
}
}
@@ -722,7 +723,7 @@ GL_APICALL void GL_APIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xo
GLenum validationError = ValidateSubImageParams(false, width, height, depth, xoffset, yoffset, zoffset, target, level, sizedInternalFormat, texture);
if(validationError == GL_NONE)
{
- texture->subImage(level, xoffset, yoffset, zoffset, width, height, depth, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
+ texture->subImage(context, level, xoffset, yoffset, zoffset, width, height, depth, sizedInternalFormat, type, context->getUnpackInfo(), context->getPixels(data));
}
else
{
@@ -3773,7 +3774,7 @@ GL_APICALL void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum
for(int level = 0; level < levels; ++level)
{
- texture->setImage(level, width, height, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
+ texture->setImage(context, level, width, height, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
width = std::max(1, (width / 2));
height = std::max(1, (height / 2));
}
@@ -3792,7 +3793,7 @@ GL_APICALL void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum
{
for(int face = GL_TEXTURE_CUBE_MAP_POSITIVE_X; face <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; ++face)
{
- texture->setImage(face, level, width, height, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
+ texture->setImage(context, face, level, width, height, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
}
width = std::max(1, (width / 2));
height = std::max(1, (height / 2));
@@ -3843,7 +3844,7 @@ GL_APICALL void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum
for(int level = 0; level < levels; ++level)
{
- texture->setImage(level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
+ texture->setImage(context, level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
width = std::max(1, (width / 2));
height = std::max(1, (height / 2));
depth = std::max(1, (depth / 2));
@@ -3868,7 +3869,7 @@ GL_APICALL void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum
{
for(int face = GL_TEXTURE_CUBE_MAP_POSITIVE_X; face <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; ++face)
{
- texture->setImage(level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
+ texture->setImage(context, level, width, height, depth, GetSizedInternalFormat(internalformat, type), type, context->getUnpackInfo(), nullptr);
}
width = std::max(1, (width / 2));
height = std::max(1, (height / 2));
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/main.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/main.cpp
index de3e7e194ad..81b1689b04d 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/main.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/main.cpp
@@ -19,7 +19,7 @@
#include "libGLESv2.hpp"
#include "Framebuffer.h"
#include "libEGL/main.h"
-#include "libEGL/EGLSurface.h"
+#include "common/Surface.hpp"
#include "Common/Thread.hpp"
#include "Common/SharedLibrary.hpp"
#include "common/debug.h"
@@ -93,14 +93,14 @@ es2::Context *getContext()
return static_cast<es2::Context*>(context);
}
- return 0;
+ return nullptr;
}
Device *getDevice()
{
Context *context = getContext();
- return context ? context->getDevice() : 0;
+ return context ? context->getDevice() : nullptr;
}
// Records an error code
@@ -1340,8 +1340,8 @@ void GL_APIENTRY Register(const char *licenseKey)
egl::Context *es2CreateContext(egl::Display *display, const egl::Context *shareContext, int clientVersion, const egl::Config *config);
extern "C" __eglMustCastToProperFunctionPointerType es2GetProcAddress(const char *procname);
-egl::Image *createBackBuffer(int width, int height, const egl::Config *config);
-egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
+egl::Image *createBackBuffer(int width, int height, sw::Format format, int multiSampleDepth);
+egl::Image *createDepthStencil(int width, int height, sw::Format format, int multiSampleDepth);
sw::FrameBuffer *createFrameBuffer(void *nativeDisplay, EGLNativeWindowType window, int width, int height);
LibGLESv2exports::LibGLESv2exports()
diff --git a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/utilities.cpp b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/utilities.cpp
index d45702ca1ed..d5b2b28be6d 100644
--- a/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/utilities.cpp
+++ b/chromium/third_party/swiftshader/src/OpenGL/libGLESv2/utilities.cpp
@@ -797,10 +797,10 @@ namespace es2
case GL_BGRA_EXT: // GL_EXT_texture_format_BGRA8888
case GL_DEPTH_STENCIL: // GL_OES_packed_depth_stencil (GL_DEPTH_STENCIL_OES)
case GL_DEPTH_COMPONENT: // GL_OES_depth_texture
+ case GL_RED_EXT: // GL_EXT_texture_rg
+ case GL_RG_EXT: // GL_EXT_texture_rg
break;
- case GL_RED:
case GL_RED_INTEGER:
- case GL_RG:
case GL_RG_INTEGER:
case GL_RGB_INTEGER:
case GL_RGBA_INTEGER:
@@ -948,6 +948,7 @@ namespace es2
{
case GL_UNSIGNED_BYTE: VALIDATE_INTERNALFORMAT(GL_RG8)
case GL_BYTE: VALIDATE_INTERNALFORMAT(GL_RG8_SNORM)
+ case GL_HALF_FLOAT_OES: break;
case GL_HALF_FLOAT: VALIDATE_INTERNALFORMAT(GL_RG16F)
case GL_FLOAT: VALIDATE_INTERNALFORMAT(GL_RG32F, GL_RG16F)
default: return error(GL_INVALID_OPERATION, false);
@@ -970,6 +971,7 @@ namespace es2
{
case GL_UNSIGNED_BYTE: VALIDATE_INTERNALFORMAT(GL_R8)
case GL_BYTE: VALIDATE_INTERNALFORMAT(GL_R8_SNORM)
+ case GL_HALF_FLOAT_OES: break;
case GL_HALF_FLOAT: VALIDATE_INTERNALFORMAT(GL_R16F)
case GL_FLOAT: VALIDATE_INTERNALFORMAT(GL_R32F, GL_R16F)
default: return error(GL_INVALID_OPERATION, false);
@@ -1042,12 +1044,16 @@ namespace es2
{
switch(internalformat)
{
+ case GL_RED_EXT:
+ case GL_RG_EXT:
case GL_RGB:
case GL_RGBA:
return isTexture;
case GL_RGBA4:
case GL_RGB5_A1:
case GL_RGB565:
+ case GL_R8_EXT:
+ case GL_RG8_EXT:
case GL_RGB8_OES:
case GL_RGBA8_OES:
case GL_R16F:
@@ -1060,14 +1066,12 @@ namespace es2
case GL_RGBA32F:
case GL_BGRA8_EXT:
return true;
- case GL_R8:
case GL_R8UI:
case GL_R8I:
case GL_R16UI:
case GL_R16I:
case GL_R32UI:
case GL_R32I:
- case GL_RG8:
case GL_RG8UI:
case GL_RG8I:
case GL_RG16UI:
@@ -1140,6 +1144,8 @@ namespace es2
case GL_RGB565:
case GL_RGB8_OES:
case GL_RGBA8_OES:
+ case GL_RED:
+ case GL_RG:
case GL_RGB:
case GL_RGBA:
case GL_R16F:
@@ -1196,6 +1202,8 @@ namespace es2
case GL_RGB565:
case GL_RGB8_OES:
case GL_RGBA8_OES:
+ case GL_RED:
+ case GL_RG:
case GL_RGB:
case GL_RGBA:
case GL_R16F:
diff --git a/chromium/third_party/swiftshader/src/Reactor/LLVMReactor.cpp b/chromium/third_party/swiftshader/src/Reactor/LLVMReactor.cpp
index bfcf2ffd71a..d8bda704104 100644
--- a/chromium/third_party/swiftshader/src/Reactor/LLVMReactor.cpp
+++ b/chromium/third_party/swiftshader/src/Reactor/LLVMReactor.cpp
@@ -6255,16 +6255,22 @@ namespace sw
RValue<Float4> Frac(RValue<Float4> x)
{
+ Float4 frc;
+
if(CPUID::supportsSSE4_1())
{
- return x - x86::floorps(x);
+ frc = x - x86::floorps(x);
}
else
{
- Float4 frc = x - Float4(Int4(x)); // Signed fractional part
+ frc = x - Float4(Int4(x)); // Signed fractional part.
- return frc + As<Float4>(As<Int4>(CmpNLE(Float4(0.0f), frc)) & As<Int4>(Float4(1, 1, 1, 1)));
+ frc += As<Float4>(As<Int4>(CmpNLE(Float4(0.0f), frc)) & As<Int4>(Float4(1.0f))); // Add 1.0 if negative.
}
+
+ // x - floor(x) can be 1.0 for very small negative x.
+ // Clamp against the value just below 1.0.
+ return Min(frc, As<Float4>(Int4(0x3F7FFFFF)));
}
RValue<Float4> Floor(RValue<Float4> x)
@@ -6370,12 +6376,10 @@ namespace sw
Nucleus::createUnreachable();
}
- bool branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB)
+ void branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB)
{
Nucleus::createCondBr(cmp.value, bodyBB, endBB);
Nucleus::setInsertBlock(bodyBB);
-
- return true;
}
RValue<Long> Ticks()
diff --git a/chromium/third_party/swiftshader/src/Reactor/Reactor.hpp b/chromium/third_party/swiftshader/src/Reactor/Reactor.hpp
index cfb005cf0e3..b02c6bea781 100644
--- a/chromium/third_party/swiftshader/src/Reactor/Reactor.hpp
+++ b/chromium/third_party/swiftshader/src/Reactor/Reactor.hpp
@@ -2162,7 +2162,7 @@ namespace sw
// RValue<Array<T>> operator--(Array<T> &val, int); // Post-decrement
// const Array<T> &operator--(Array<T> &val); // Pre-decrement
- bool branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB);
+ void branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB);
void Return();
void Return(RValue<Int> ret);
diff --git a/chromium/third_party/swiftshader/src/Reactor/SubzeroReactor.cpp b/chromium/third_party/swiftshader/src/Reactor/SubzeroReactor.cpp
index c0ebb81a461..fb116a3e8cd 100644
--- a/chromium/third_party/swiftshader/src/Reactor/SubzeroReactor.cpp
+++ b/chromium/third_party/swiftshader/src/Reactor/SubzeroReactor.cpp
@@ -450,7 +450,7 @@ namespace sw
buffer.reserve(0x1000);
}
- virtual ~ELFMemoryStreamer()
+ ~ELFMemoryStreamer() override
{
#if defined(_WIN32)
if(buffer.size() != 0)
@@ -492,20 +492,16 @@ namespace sw
{
if(!entry)
{
- #if defined(_WIN32)
- VirtualProtect(&buffer[0], buffer.size(), PAGE_EXECUTE_READWRITE, &oldProtection);
- #else
- mprotect(&buffer[0], buffer.size(), PROT_READ | PROT_WRITE | PROT_EXEC);
- #endif
-
position = std::numeric_limits<std::size_t>::max(); // Can't stream more data after this
size_t codeSize = 0;
entry = loadImage(&buffer[0], codeSize);
#if defined(_WIN32)
+ VirtualProtect(&buffer[0], buffer.size(), PAGE_EXECUTE_READ, &oldProtection);
FlushInstructionCache(GetCurrentProcess(), NULL, 0);
#else
+ mprotect(&buffer[0], buffer.size(), PROT_READ | PROT_EXEC);
__builtin___clear_cache((char*)entry, (char*)entry + codeSize);
#endif
}
@@ -563,6 +559,8 @@ namespace sw
Nucleus::~Nucleus()
{
+ delete ::routine;
+
delete ::allocator;
delete ::function;
delete ::context;
@@ -589,11 +587,11 @@ namespace sw
::function->translate();
assert(!::function->hasError());
- auto *globals = ::function->getGlobalInits().release();
+ auto globals = ::function->getGlobalInits();
if(globals && !globals->empty())
{
- ::context->getGlobals()->merge(globals);
+ ::context->getGlobals()->merge(globals.get());
}
::context->emitFileHeader();
@@ -608,7 +606,10 @@ namespace sw
objectWriter->setUndefinedSyms(::context->getConstantExternSyms());
objectWriter->writeNonUserSections();
- return ::routine;
+ Routine *handoffRoutine = ::routine;
+ ::routine = nullptr;
+
+ return handoffRoutine;
}
void Nucleus::optimize()
@@ -6324,16 +6325,22 @@ namespace sw
RValue<Float4> Frac(RValue<Float4> x)
{
+ Float4 frc;
+
if(CPUID::SSE4_1)
{
- return x - Floor(x);
+ frc = x - Floor(x);
}
else
{
- Float4 frc = x - Float4(Int4(x)); // Signed fractional part
+ frc = x - Float4(Int4(x)); // Signed fractional part.
- return frc + As<Float4>(As<Int4>(CmpNLE(Float4(0.0f), frc)) & As<Int4>(Float4(1, 1, 1, 1)));
+ frc += As<Float4>(As<Int4>(CmpNLE(Float4(0.0f), frc)) & As<Int4>(Float4(1, 1, 1, 1))); // Add 1.0 if negative.
}
+
+ // x - floor(x) can be 1.0 for very small negative x.
+ // Clamp against the value just below 1.0.
+ return Min(frc, As<Float4>(Int4(0x3F7FFFFF)));
}
RValue<Float4> Floor(RValue<Float4> x)
@@ -6455,12 +6462,10 @@ namespace sw
Nucleus::createUnreachable();
}
- bool branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB)
+ void branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB)
{
Nucleus::createCondBr(cmp.value, bodyBB, endBB);
Nucleus::setInsertBlock(bodyBB);
-
- return true;
}
RValue<Long> Ticks()
diff --git a/chromium/third_party/swiftshader/src/Renderer/Blitter.cpp b/chromium/third_party/swiftshader/src/Renderer/Blitter.cpp
index 4eea8523072..c93b09f6312 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Blitter.cpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Blitter.cpp
@@ -20,8 +20,6 @@
namespace sw
{
- Blitter blitter;
-
Blitter::Blitter()
{
blitCache = new RoutineCache<BlitState>(1024);
@@ -39,11 +37,12 @@ namespace sw
return;
}
- sw::Surface color(1, 1, 1, format, pixel, sw::Surface::bytes(format), sw::Surface::bytes(format));
+ sw::Surface *color = sw::Surface::create(1, 1, 1, format, pixel, sw::Surface::bytes(format), sw::Surface::bytes(format));
Blitter::Options clearOptions = static_cast<sw::Blitter::Options>((rgbaMask & 0xF) | CLEAR_OPERATION);
SliceRect sRect(dRect);
sRect.slice = 0;
- blit(&color, sRect, dest, dRect, clearOptions);
+ blit(color, sRect, dest, dRect, clearOptions);
+ delete color;
}
bool Blitter::fastClear(void* pixel, sw::Format format, Surface *dest, const SliceRect &dRect, unsigned int rgbaMask)
diff --git a/chromium/third_party/swiftshader/src/Renderer/Blitter.hpp b/chromium/third_party/swiftshader/src/Renderer/Blitter.hpp
index c72b21ab9ad..f04dc249d20 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Blitter.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Blitter.hpp
@@ -73,7 +73,6 @@ namespace sw
public:
Blitter();
-
virtual ~Blitter();
void clear(void* pixel, sw::Format format, Surface *dest, const SliceRect &dRect, unsigned int rgbaMask);
@@ -97,8 +96,6 @@ namespace sw
RoutineCache<BlitState> *blitCache;
MutexLock criticalSection;
};
-
- extern Blitter blitter;
}
#endif // sw_Blitter_hpp
diff --git a/chromium/third_party/swiftshader/src/Renderer/LRUCache.hpp b/chromium/third_party/swiftshader/src/Renderer/LRUCache.hpp
index 77f9ab7e351..1a1a302c89c 100644
--- a/chromium/third_party/swiftshader/src/Renderer/LRUCache.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/LRUCache.hpp
@@ -58,10 +58,10 @@ namespace sw
key = new Key[size];
ref = new Key*[size];
data = new Data*[size];
-
+
for(int i = 0; i < size; i++)
{
- data[i] = 0;
+ data[i] = nullptr;
ref[i] = &key[i];
}
@@ -71,22 +71,22 @@ namespace sw
LRUCache<Key, Data>::~LRUCache()
{
delete[] key;
- key = 0;
+ key = nullptr;
delete[] ref;
- ref = 0;
+ ref = nullptr;
for(int i = 0; i < size; i++)
{
if(data[i])
{
data[i]->unbind();
- data[i] = 0;
+ data[i] = nullptr;
}
}
delete[] data;
- data = 0;
+ data = nullptr;
}
template<class Key, class Data>
@@ -118,9 +118,9 @@ namespace sw
}
}
- return 0; // Not found
+ return nullptr; // Not found
}
-
+
template<class Key, class Data>
Data *LRUCache<Key, Data>::add(const Key &key, Data *data)
{
@@ -128,9 +128,9 @@ namespace sw
fill = fill + 1 < size ? fill + 1 : size;
*ref[top] = key;
-
+
data->bind();
-
+
if(this->data[top])
{
this->data[top]->unbind();
diff --git a/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.cpp b/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.cpp
index 172e8efea8e..db11aeda72c 100644
--- a/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.cpp
+++ b/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.cpp
@@ -444,6 +444,15 @@ namespace sw
else ASSERT(false);
}
+ void PixelProcessor::setHighPrecisionFiltering(unsigned int sampler, bool highPrecisionFiltering)
+ {
+ if(sampler < TEXTURE_IMAGE_UNITS)
+ {
+ context->sampler[sampler].setHighPrecisionFiltering(highPrecisionFiltering);
+ }
+ else ASSERT(false);
+ }
+
void PixelProcessor::setSwizzleR(unsigned int sampler, SwizzleType swizzleR)
{
if(sampler < TEXTURE_IMAGE_UNITS)
diff --git a/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.hpp b/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.hpp
index 94d52d39c6a..dd54b721599 100644
--- a/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/PixelProcessor.hpp
@@ -231,6 +231,7 @@ namespace sw
void setMipmapLOD(unsigned int sampler, float bias);
void setBorderColor(unsigned int sampler, const Color<float> &borderColor);
void setMaxAnisotropy(unsigned int sampler, float maxAnisotropy);
+ void setHighPrecisionFiltering(unsigned int sampler, bool highPrecisionFiltering);
void setSwizzleR(unsigned int sampler, SwizzleType swizzleR);
void setSwizzleG(unsigned int sampler, SwizzleType swizzleG);
void setSwizzleB(unsigned int sampler, SwizzleType swizzleB);
diff --git a/chromium/third_party/swiftshader/src/Renderer/Renderer.cpp b/chromium/third_party/swiftshader/src/Renderer/Renderer.cpp
index a8f6032bc0f..a67ba22ffe2 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Renderer.cpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Renderer.cpp
@@ -114,6 +114,7 @@ namespace sw
setRenderTarget(0, 0);
clipper = new Clipper(symmetricNormalizedDepth);
+ blitter = new Blitter;
updateViewMatrix = true;
updateBaseMatrix = true;
@@ -177,7 +178,10 @@ namespace sw
sync->destruct();
delete clipper;
- clipper = 0;
+ clipper = nullptr;
+
+ delete blitter;
+ blitter = nullptr;
terminateThreads();
delete resumeApp;
@@ -202,21 +206,6 @@ namespace sw
sw::deallocate(mem);
}
- void Renderer::clear(void *pixel, Format format, Surface *dest, const SliceRect &dRect, unsigned int rgbaMask)
- {
- blitter.clear(pixel, format, dest, dRect, rgbaMask);
- }
-
- void Renderer::blit(Surface *source, const SliceRect &sRect, Surface *dest, const SliceRect &dRect, bool filter, bool isStencil)
- {
- blitter.blit(source, sRect, dest, dRect, filter, isStencil);
- }
-
- void Renderer::blit3D(Surface *source, Surface *dest)
- {
- blitter.blit3D(source, dest);
- }
-
void Renderer::draw(DrawType drawType, unsigned int indexOffset, unsigned int count, bool update)
{
#ifndef NDEBUG
@@ -681,6 +670,21 @@ namespace sw
}
}
+ void Renderer::clear(void *pixel, Format format, Surface *dest, const SliceRect &dRect, unsigned int rgbaMask)
+ {
+ blitter->clear(pixel, format, dest, dRect, rgbaMask);
+ }
+
+ void Renderer::blit(Surface *source, const SliceRect &sRect, Surface *dest, const SliceRect &dRect, bool filter, bool isStencil)
+ {
+ blitter->blit(source, sRect, dest, dRect, filter, isStencil);
+ }
+
+ void Renderer::blit3D(Surface *source, Surface *dest)
+ {
+ blitter->blit3D(source, dest);
+ }
+
void Renderer::threadFunction(void *parameters)
{
Renderer *renderer = static_cast<Parameters*>(parameters)->renderer;
@@ -2310,6 +2314,18 @@ namespace sw
}
}
+ void Renderer::setHighPrecisionFiltering(SamplerType type, int sampler, bool highPrecisionFiltering)
+ {
+ if(type == SAMPLER_PIXEL)
+ {
+ PixelProcessor::setHighPrecisionFiltering(sampler, highPrecisionFiltering);
+ }
+ else
+ {
+ VertexProcessor::setHighPrecisionFiltering(sampler, highPrecisionFiltering);
+ }
+ }
+
void Renderer::setSwizzleR(SamplerType type, int sampler, SwizzleType swizzleR)
{
if(type == SAMPLER_PIXEL)
diff --git a/chromium/third_party/swiftshader/src/Renderer/Renderer.hpp b/chromium/third_party/swiftshader/src/Renderer/Renderer.hpp
index 49d02499018..c29020fa404 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Renderer.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Renderer.hpp
@@ -321,10 +321,11 @@ namespace sw
void *operator new(size_t size);
void operator delete(void * mem);
+ void draw(DrawType drawType, unsigned int indexOffset, unsigned int count, bool update = true);
+
void clear(void* pixel, Format format, Surface *dest, const SliceRect &dRect, unsigned int rgbaMask);
void blit(Surface *source, const SliceRect &sRect, Surface *dest, const SliceRect &dRect, bool filter, bool isStencil = false);
void blit3D(Surface *source, Surface *dest);
- void draw(DrawType drawType, unsigned int indexOffset, unsigned int count, bool update = true);
void setIndexBuffer(Resource *indexBuffer);
@@ -344,6 +345,7 @@ namespace sw
void setMipmapLOD(SamplerType type, int sampler, float bias);
void setBorderColor(SamplerType type, int sampler, const Color<float> &borderColor);
void setMaxAnisotropy(SamplerType type, int sampler, float maxAnisotropy);
+ void setHighPrecisionFiltering(SamplerType type, int sampler, bool highPrecisionFiltering);
void setSwizzleR(SamplerType type, int sampler, SwizzleType swizzleR);
void setSwizzleG(SamplerType type, int sampler, SwizzleType swizzleG);
void setSwizzleB(SamplerType type, int sampler, SwizzleType swizzleB);
@@ -431,6 +433,7 @@ namespace sw
Context *context;
Clipper *clipper;
+ Blitter *blitter;
Viewport viewport;
Rect scissor;
int clipFlags;
diff --git a/chromium/third_party/swiftshader/src/Renderer/Sampler.cpp b/chromium/third_party/swiftshader/src/Renderer/Sampler.cpp
index e2447e0e707..7d7d47c3a9b 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Sampler.cpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Sampler.cpp
@@ -60,6 +60,7 @@ namespace sw
mipmapFilterState = MIPMAP_NONE;
sRGB = false;
gather = false;
+ highPrecisionFiltering = false;
swizzleR = SWIZZLE_RED;
swizzleG = SWIZZLE_GREEN;
@@ -97,6 +98,7 @@ namespace sw
state.swizzleG = swizzleG;
state.swizzleB = swizzleB;
state.swizzleA = swizzleA;
+ state.highPrecisionFiltering = highPrecisionFiltering;
#if PERF_PROFILE
state.compressedFormat = Surface::isCompressed(externalTextureFormat);
@@ -298,6 +300,11 @@ namespace sw
texture.maxAnisotropy = maxAnisotropy;
}
+ void Sampler::setHighPrecisionFiltering(bool highPrecisionFiltering)
+ {
+ this->highPrecisionFiltering = highPrecisionFiltering;
+ }
+
void Sampler::setSwizzleR(SwizzleType swizzleR)
{
this->swizzleR = swizzleR;
diff --git a/chromium/third_party/swiftshader/src/Renderer/Sampler.hpp b/chromium/third_party/swiftshader/src/Renderer/Sampler.hpp
index 4c4973db59b..288f179a2c6 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Sampler.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Sampler.hpp
@@ -140,6 +140,7 @@ namespace sw
SwizzleType swizzleG : BITS(SWIZZLE_LAST);
SwizzleType swizzleB : BITS(SWIZZLE_LAST);
SwizzleType swizzleA : BITS(SWIZZLE_LAST);
+ bool highPrecisionFiltering : 1;
#if PERF_PROFILE
bool compressedFormat : 1;
@@ -163,6 +164,7 @@ namespace sw
void setReadSRGB(bool sRGB);
void setBorderColor(const Color<float> &borderColor);
void setMaxAnisotropy(float maxAnisotropy);
+ void setHighPrecisionFiltering(bool highPrecisionFiltering);
void setSwizzleR(SwizzleType swizzleR);
void setSwizzleG(SwizzleType swizzleG);
void setSwizzleB(SwizzleType swizzleB);
@@ -202,6 +204,7 @@ namespace sw
MipmapType mipmapFilterState;
bool sRGB;
bool gather;
+ bool highPrecisionFiltering;
SwizzleType swizzleR;
SwizzleType swizzleG;
diff --git a/chromium/third_party/swiftshader/src/Renderer/Surface.cpp b/chromium/third_party/swiftshader/src/Renderer/Surface.cpp
index c7ca71aefee..6615b4bab7a 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Surface.cpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Surface.cpp
@@ -41,7 +41,6 @@ namespace sw
unsigned int *Surface::palette = 0;
unsigned int Surface::paletteID = 0;
- void Surface::typeinfo() {}
void Rect::clip(int minX, int minY, int maxX, int maxY)
{
@@ -1168,6 +1167,36 @@ namespace sw
lock = LOCK_UNLOCKED;
}
+ class SurfaceImplementation : public Surface
+ {
+ public:
+ SurfaceImplementation(int width, int height, int depth, Format format, void *pixels, int pitch, int slice)
+ : Surface(width, height, depth, format, pixels, pitch, slice) {}
+ SurfaceImplementation(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget, int pitchP = 0)
+ : Surface(texture, width, height, depth, format, lockable, renderTarget, pitchP) {}
+ ~SurfaceImplementation() override {};
+
+ void *lockInternal(int x, int y, int z, Lock lock, Accessor client) override
+ {
+ return Surface::lockInternal(x, y, z, lock, client);
+ }
+
+ void unlockInternal() override
+ {
+ Surface::unlockInternal();
+ }
+ };
+
+ Surface *Surface::create(int width, int height, int depth, Format format, void *pixels, int pitch, int slice)
+ {
+ return new SurfaceImplementation(width, height, depth, format, pixels, pitch, slice);
+ }
+
+ Surface *Surface::create(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget, int pitchPprovided)
+ {
+ return new SurfaceImplementation(texture, width, height, depth, format, lockable, renderTarget, pitchPprovided);
+ }
+
Surface::Surface(int width, int height, int depth, Format format, void *pixels, int pitch, int slice) : lockable(true), renderTarget(false)
{
resource = new Resource(0);
@@ -1272,9 +1301,7 @@ namespace sw
{
// sync() must be called before this destructor to ensure all locks have been released.
// We can't call it here because the parent resource may already have been destroyed.
- ASSERT(external.lock == LOCK_UNLOCKED);
- ASSERT(internal.lock == LOCK_UNLOCKED);
- ASSERT(stencil.lock == LOCK_UNLOCKED);
+ ASSERT(isUnlocked());
if(!hasParent)
{
@@ -1342,9 +1369,9 @@ namespace sw
void Surface::unlockExternal()
{
- resource->unlock();
-
external.unlockRect();
+
+ resource->unlock();
}
void *Surface::lockInternal(int x, int y, int z, Lock lock, Accessor client)
@@ -1426,9 +1453,9 @@ namespace sw
void Surface::unlockInternal()
{
- resource->unlock();
-
internal.unlockRect();
+
+ resource->unlock();
}
void *Surface::lockStencil(int x, int y, int front, Accessor client)
@@ -1445,9 +1472,9 @@ namespace sw
void Surface::unlockStencil()
{
- resource->unlock();
-
stencil.unlockRect();
+
+ resource->unlock();
}
int Surface::bytes(Format format)
@@ -3089,7 +3116,7 @@ namespace sw
// FIXME: Unpacking byte4 to short4 in the sampler currently involves reading 8 bytes,
// and stencil operations also read 8 bytes per four 8-bit stencil values,
// so we have to allocate 4 extra bytes to avoid buffer overruns.
- return allocateZero(size(width2, height2, depth, format) + 4);
+ return allocate(size(width2, height2, depth, format) + 4);
}
void Surface::memfill4(void *buffer, int pattern, int bytes)
diff --git a/chromium/third_party/swiftshader/src/Renderer/Surface.hpp b/chromium/third_party/swiftshader/src/Renderer/Surface.hpp
index ae37df532ae..b54565e698b 100644
--- a/chromium/third_party/swiftshader/src/Renderer/Surface.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/Surface.hpp
@@ -250,13 +250,15 @@ namespace sw
bool dirty;
};
- virtual void typeinfo(); // Dummy key method (https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html)
-
- public:
+ protected:
Surface(int width, int height, int depth, Format format, void *pixels, int pitch, int slice);
Surface(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget, int pitchP = 0);
- virtual ~Surface();
+ public:
+ static Surface *create(int width, int height, int depth, Format format, void *pixels, int pitch, int slice);
+ static Surface *create(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget, int pitchP = 0);
+
+ virtual ~Surface() = 0;
inline void *lock(int x, int y, int z, Lock lock, Accessor client, bool internal = false);
inline void unlock(bool internal = false);
@@ -277,8 +279,8 @@ namespace sw
inline int getExternalSliceB() const;
inline int getExternalSliceP() const;
- virtual void *lockInternal(int x, int y, int z, Lock lock, Accessor client);
- virtual void unlockInternal();
+ virtual void *lockInternal(int x, int y, int z, Lock lock, Accessor client) = 0;
+ virtual void unlockInternal() = 0;
inline Format getInternalFormat() const;
inline int getInternalPitchB() const;
inline int getInternalPitchP() const;
@@ -291,7 +293,8 @@ namespace sw
inline int getStencilPitchB() const;
inline int getStencilSliceB() const;
- void sync(); // Wait for lock(s) to be released
+ void sync(); // Wait for lock(s) to be released.
+ inline bool isUnlocked() const; // Only reliable after sync().
inline int getMultiSampleCount() const;
inline int getSuperSampleCount() const;
@@ -606,6 +609,13 @@ namespace sw
return internal.depth > 4 ? internal.depth / 4 : 1;
}
+ bool Surface::isUnlocked() const
+ {
+ return external.lock == LOCK_UNLOCKED &&
+ internal.lock == LOCK_UNLOCKED &&
+ stencil.lock == LOCK_UNLOCKED;
+ }
+
bool Surface::isExternalDirty() const
{
return external.buffer && external.buffer != internal.buffer && external.dirty;
diff --git a/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.cpp b/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.cpp
index 91c4d34672c..6972d94ce71 100644
--- a/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.cpp
+++ b/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.cpp
@@ -602,6 +602,15 @@ namespace sw
else ASSERT(false);
}
+ void VertexProcessor::setHighPrecisionFiltering(unsigned int sampler, bool highPrecisionFiltering)
+ {
+ if(sampler < TEXTURE_IMAGE_UNITS)
+ {
+ context->sampler[sampler].setHighPrecisionFiltering(highPrecisionFiltering);
+ }
+ else ASSERT(false);
+ }
+
void VertexProcessor::setSwizzleR(unsigned int sampler, SwizzleType swizzleR)
{
if(sampler < VERTEX_TEXTURE_IMAGE_UNITS)
diff --git a/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.hpp b/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.hpp
index 278c9b179a7..3552f847da9 100644
--- a/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.hpp
+++ b/chromium/third_party/swiftshader/src/Renderer/VertexProcessor.hpp
@@ -258,6 +258,7 @@ namespace sw
void setMipmapLOD(unsigned int sampler, float bias);
void setBorderColor(unsigned int sampler, const Color<float> &borderColor);
void setMaxAnisotropy(unsigned int stage, float maxAnisotropy);
+ void setHighPrecisionFiltering(unsigned int sampler, bool highPrecisionFiltering);
void setSwizzleR(unsigned int sampler, SwizzleType swizzleR);
void setSwizzleG(unsigned int sampler, SwizzleType swizzleG);
void setSwizzleB(unsigned int sampler, SwizzleType swizzleB);
diff --git a/chromium/third_party/swiftshader/src/Shader/SamplerCore.cpp b/chromium/third_party/swiftshader/src/Shader/SamplerCore.cpp
index 6025291f0ae..9bd977e9388 100644
--- a/chromium/third_party/swiftshader/src/Shader/SamplerCore.cpp
+++ b/chromium/third_party/swiftshader/src/Shader/SamplerCore.cpp
@@ -314,7 +314,7 @@ namespace sw
}
else
{
- if(hasFloatTexture()) // FIXME: Mostly identical to integer sampling
+ if(hasFloatTexture() || state.highPrecisionFiltering) // FIXME: Mostly identical to integer sampling
{
Float4 uuuu = u;
Float4 vvvv = v;
@@ -360,35 +360,35 @@ namespace sw
sampleTexture(texture, cs, u, v, w, q, dsx, dsy, offset, function, false);
- for(int component = 0; component < textureComponentCount(); component++)
+ if(has16bitTextureFormat())
{
- if(has16bitTextureFormat())
+ switch(state.textureFormat)
{
- switch(state.textureFormat)
+ case FORMAT_R5G6B5:
+ if(state.sRGB)
{
- case FORMAT_R5G6B5:
- if(state.sRGB)
- {
- sRGBtoLinear16_5_12(cs.x);
- sRGBtoLinear16_6_12(cs.y);
- sRGBtoLinear16_5_12(cs.z);
+ sRGBtoLinear16_5_12(cs.x);
+ sRGBtoLinear16_6_12(cs.y);
+ sRGBtoLinear16_5_12(cs.z);
- convertSigned12(c.x, cs.x);
- convertSigned12(c.y, cs.y);
- convertSigned12(c.z, cs.z);
- }
- else
- {
- c.x = Float4(As<UShort4>(cs.x)) * Float4(1.0f / 0xF800);
- c.y = Float4(As<UShort4>(cs.y)) * Float4(1.0f / 0xFC00);
- c.z = Float4(As<UShort4>(cs.z)) * Float4(1.0f / 0xF800);
- }
- break;
- default:
- ASSERT(false);
+ convertSigned12(c.x, cs.x);
+ convertSigned12(c.y, cs.y);
+ convertSigned12(c.z, cs.z);
}
+ else
+ {
+ c.x = Float4(As<UShort4>(cs.x)) * Float4(1.0f / 0xF800);
+ c.y = Float4(As<UShort4>(cs.y)) * Float4(1.0f / 0xFC00);
+ c.z = Float4(As<UShort4>(cs.z)) * Float4(1.0f / 0xF800);
+ }
+ break;
+ default:
+ ASSERT(false);
}
- else
+ }
+ else
+ {
+ for(int component = 0; component < textureComponentCount(); component++)
{
switch(state.textureFormat)
{
@@ -495,6 +495,9 @@ namespace sw
case FORMAT_V16U16:
case FORMAT_A16W16V16U16:
case FORMAT_Q16W16V16U16:
+ case FORMAT_YV12_BT601:
+ case FORMAT_YV12_BT709:
+ case FORMAT_YV12_JFIF:
if(componentCount < 2) c.y = Float4(1.0f);
if(componentCount < 3) c.z = Float4(1.0f);
if(componentCount < 4) c.w = Float4(1.0f);
@@ -1741,12 +1744,8 @@ namespace sw
}
}
- void SamplerCore::sampleTexel(Vector4s &c, Short4 &uuuu, Short4 &vvvv, Short4 &wwww, Vector4f &offset, Pointer<Byte> &mipmap, Pointer<Byte> buffer[4], SamplerFunction function)
+ void SamplerCore::sampleTexel(Vector4s &c, UInt index[4], Pointer<Byte> buffer[4])
{
- UInt index[4];
-
- computeIndices(index, uuuu, vvvv, wwww, offset, mipmap, function);
-
int f0 = state.textureType == TEXTURE_CUBE ? 0 : 0;
int f1 = state.textureType == TEXTURE_CUBE ? 1 : 0;
int f2 = state.textureType == TEXTURE_CUBE ? 2 : 0;
@@ -1921,7 +1920,16 @@ namespace sw
ASSERT(false);
}
}
- else if(hasYuvFormat())
+ else ASSERT(false);
+ }
+
+ void SamplerCore::sampleTexel(Vector4s &c, Short4 &uuuu, Short4 &vvvv, Short4 &wwww, Vector4f &offset, Pointer<Byte> &mipmap, Pointer<Byte> buffer[4], SamplerFunction function)
+ {
+ UInt index[4];
+
+ computeIndices(index, uuuu, vvvv, wwww, offset, mipmap, function);
+
+ if(hasYuvFormat())
{
// Generic YPbPr to RGB transformation
// R = Y + 2 * (1 - Kr) * Pr
@@ -2015,7 +2023,10 @@ namespace sw
c.y = Min(g, UShort4(0x3FFF)) << 2;
c.z = Min(b, UShort4(0x3FFF)) << 2;
}
- else ASSERT(false);
+ else
+ {
+ sampleTexel(c, index, buffer);
+ }
}
void SamplerCore::sampleTexel(Vector4f &c, Short4 &uuuu, Short4 &vvvv, Short4 &wwww, Vector4f &offset, Float4 &z, Pointer<Byte> &mipmap, Pointer<Byte> buffer[4], SamplerFunction function)
@@ -2024,56 +2035,94 @@ namespace sw
computeIndices(index, uuuu, vvvv, wwww, offset, mipmap, function);
- int f0 = state.textureType == TEXTURE_CUBE ? 0 : 0;
- int f1 = state.textureType == TEXTURE_CUBE ? 1 : 0;
- int f2 = state.textureType == TEXTURE_CUBE ? 2 : 0;
- int f3 = state.textureType == TEXTURE_CUBE ? 3 : 0;
-
- // Read texels
- switch(textureComponentCount())
+ if(hasFloatTexture())
{
- case 4:
- c.x = *Pointer<Float4>(buffer[f0] + index[0] * 16, 16);
- c.y = *Pointer<Float4>(buffer[f1] + index[1] * 16, 16);
- c.z = *Pointer<Float4>(buffer[f2] + index[2] * 16, 16);
- c.w = *Pointer<Float4>(buffer[f3] + index[3] * 16, 16);
- transpose4x4(c.x, c.y, c.z, c.w);
- break;
- case 3:
- ASSERT(state.textureFormat == FORMAT_X32B32G32R32F);
- c.x = *Pointer<Float4>(buffer[f0] + index[0] * 16, 16);
- c.y = *Pointer<Float4>(buffer[f1] + index[1] * 16, 16);
- c.z = *Pointer<Float4>(buffer[f2] + index[2] * 16, 16);
- c.w = *Pointer<Float4>(buffer[f3] + index[3] * 16, 16);
- transpose4x3(c.x, c.y, c.z, c.w);
- c.w = Float4(1.0f);
- break;
- case 2:
- // FIXME: Optimal shuffling?
- c.x.xy = *Pointer<Float4>(buffer[f0] + index[0] * 8);
- c.x.zw = *Pointer<Float4>(buffer[f1] + index[1] * 8 - 8);
- c.z.xy = *Pointer<Float4>(buffer[f2] + index[2] * 8);
- c.z.zw = *Pointer<Float4>(buffer[f3] + index[3] * 8 - 8);
- c.y = c.x;
- c.x = Float4(c.x.xz, c.z.xz);
- c.y = Float4(c.y.yw, c.z.yw);
- break;
- case 1:
- // FIXME: Optimal shuffling?
- c.x.x = *Pointer<Float>(buffer[f0] + index[0] * 4);
- c.x.y = *Pointer<Float>(buffer[f1] + index[1] * 4);
- c.x.z = *Pointer<Float>(buffer[f2] + index[2] * 4);
- c.x.w = *Pointer<Float>(buffer[f3] + index[3] * 4);
-
- if(state.textureFormat == FORMAT_D32FS8_SHADOW && state.textureFilter != FILTER_GATHER)
+ int f0 = state.textureType == TEXTURE_CUBE ? 0 : 0;
+ int f1 = state.textureType == TEXTURE_CUBE ? 1 : 0;
+ int f2 = state.textureType == TEXTURE_CUBE ? 2 : 0;
+ int f3 = state.textureType == TEXTURE_CUBE ? 3 : 0;
+
+ // Read texels
+ switch(textureComponentCount())
{
- Float4 d = Min(Max(z, Float4(0.0f)), Float4(1.0f));
+ case 4:
+ c.x = *Pointer<Float4>(buffer[f0] + index[0] * 16, 16);
+ c.y = *Pointer<Float4>(buffer[f1] + index[1] * 16, 16);
+ c.z = *Pointer<Float4>(buffer[f2] + index[2] * 16, 16);
+ c.w = *Pointer<Float4>(buffer[f3] + index[3] * 16, 16);
+ transpose4x4(c.x, c.y, c.z, c.w);
+ break;
+ case 3:
+ ASSERT(state.textureFormat == FORMAT_X32B32G32R32F);
+ c.x = *Pointer<Float4>(buffer[f0] + index[0] * 16, 16);
+ c.y = *Pointer<Float4>(buffer[f1] + index[1] * 16, 16);
+ c.z = *Pointer<Float4>(buffer[f2] + index[2] * 16, 16);
+ c.w = *Pointer<Float4>(buffer[f3] + index[3] * 16, 16);
+ transpose4x3(c.x, c.y, c.z, c.w);
+ c.w = Float4(1.0f);
+ break;
+ case 2:
+ // FIXME: Optimal shuffling?
+ c.x.xy = *Pointer<Float4>(buffer[f0] + index[0] * 8);
+ c.x.zw = *Pointer<Float4>(buffer[f1] + index[1] * 8 - 8);
+ c.z.xy = *Pointer<Float4>(buffer[f2] + index[2] * 8);
+ c.z.zw = *Pointer<Float4>(buffer[f3] + index[3] * 8 - 8);
+ c.y = c.x;
+ c.x = Float4(c.x.xz, c.z.xz);
+ c.y = Float4(c.y.yw, c.z.yw);
+ break;
+ case 1:
+ // FIXME: Optimal shuffling?
+ c.x.x = *Pointer<Float>(buffer[f0] + index[0] * 4);
+ c.x.y = *Pointer<Float>(buffer[f1] + index[1] * 4);
+ c.x.z = *Pointer<Float>(buffer[f2] + index[2] * 4);
+ c.x.w = *Pointer<Float>(buffer[f3] + index[3] * 4);
+
+ if(state.textureFormat == FORMAT_D32FS8_SHADOW && state.textureFilter != FILTER_GATHER)
+ {
+ Float4 d = Min(Max(z, Float4(0.0f)), Float4(1.0f));
- c.x = As<Float4>(As<Int4>(CmpNLT(c.x, d)) & As<Int4>(Float4(1.0f))); // FIXME: Only less-equal?
+ c.x = As<Float4>(As<Int4>(CmpNLT(c.x, d)) & As<Int4>(Float4(1.0f))); // FIXME: Only less-equal?
+ }
+ break;
+ default:
+ ASSERT(false);
+ }
+ }
+ else
+ {
+ ASSERT(!hasYuvFormat());
+
+ Vector4s cs;
+ sampleTexel(cs, index, buffer);
+
+ bool isInteger = Surface::isNonNormalizedInteger(state.textureFormat);
+ int componentCount = textureComponentCount();
+ for(int n = 0; n < componentCount; ++n)
+ {
+ if(hasUnsignedTextureComponent(n))
+ {
+ if(isInteger)
+ {
+ c[n] = As<Float4>(Int4(As<UShort4>(cs[n])));
+ }
+ else
+ {
+ c[n] = Float4(As<UShort4>(cs[n]));
+ }
+ }
+ else
+ {
+ if(isInteger)
+ {
+ c[n] = As<Float4>(Int4(cs[n]));
+ }
+ else
+ {
+ c[n] = Float4(cs[n]);
+ }
+ }
}
- break;
- default:
- ASSERT(false);
}
}
diff --git a/chromium/third_party/swiftshader/src/Shader/SamplerCore.hpp b/chromium/third_party/swiftshader/src/Shader/SamplerCore.hpp
index 0f90cac7c8c..f4a9abdbbf6 100644
--- a/chromium/third_party/swiftshader/src/Shader/SamplerCore.hpp
+++ b/chromium/third_party/swiftshader/src/Shader/SamplerCore.hpp
@@ -76,6 +76,7 @@ namespace sw
Short4 applyOffset(Short4 &uvw, Float4 &offset, const Int4 &whd, AddressingMode mode);
void computeIndices(UInt index[4], Short4 uuuu, Short4 vvvv, Short4 wwww, Vector4f &offset, const Pointer<Byte> &mipmap, SamplerFunction function);
void sampleTexel(Vector4s &c, Short4 &u, Short4 &v, Short4 &s, Vector4f &offset, Pointer<Byte> &mipmap, Pointer<Byte> buffer[4], SamplerFunction function);
+ void sampleTexel(Vector4s &c, UInt index[4], Pointer<Byte> buffer[4]);
void sampleTexel(Vector4f &c, Short4 &u, Short4 &v, Short4 &s, Vector4f &offset, Float4 &z, Pointer<Byte> &mipmap, Pointer<Byte> buffer[4], SamplerFunction function);
void selectMipmap(Pointer<Byte> &texture, Pointer<Byte> buffer[4], Pointer<Byte> &mipmap, Float &lod, Int face[4], bool secondLOD);
Short4 address(Float4 &uw, AddressingMode addressingMode, Pointer<Byte>& mipmap);
diff --git a/chromium/third_party/swiftshader/src/Shader/ShaderCore.cpp b/chromium/third_party/swiftshader/src/Shader/ShaderCore.cpp
index 424636be1ff..5799d3f02ba 100644
--- a/chromium/third_party/swiftshader/src/Shader/ShaderCore.cpp
+++ b/chromium/third_party/swiftshader/src/Shader/ShaderCore.cpp
@@ -978,10 +978,10 @@ namespace sw
void ShaderCore::log2(Vector4f &dst, const Vector4f &src, bool pp)
{
- dst.x = logarithm2(src.x, pp);
- dst.y = logarithm2(src.y, pp);
- dst.z = logarithm2(src.z, pp);
- dst.w = logarithm2(src.w, pp);
+ dst.x = logarithm2(src.x, false, pp);
+ dst.y = logarithm2(src.y, false, pp);
+ dst.z = logarithm2(src.z, false, pp);
+ dst.w = logarithm2(src.w, false, pp);
}
void ShaderCore::log(Vector4f &dst, const Vector4f &src, bool pp)
diff --git a/chromium/third_party/swiftshader/tests/unittests/BUILD.gn b/chromium/third_party/swiftshader/tests/unittests/BUILD.gn
index 5448bc6b87a..aa7dfefaf6b 100644
--- a/chromium/third_party/swiftshader/tests/unittests/BUILD.gn
+++ b/chromium/third_party/swiftshader/tests/unittests/BUILD.gn
@@ -16,12 +16,12 @@ import("//testing/test.gni")
test("swiftshader_unittests") {
deps = [
- "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
- "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
+ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
+ "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
sources = [
@@ -29,9 +29,9 @@ test("swiftshader_unittests") {
"unittests.cpp",
]
- include_dirs = [
- "../../include", # Khronos headers
- ]
+ include_dirs = [ "../../include" ] # Khronos headers
+
+ defines = [ "GL_GLEXT_PROTOTYPES" ]
# Make sure we're loading SwiftShader's libraries, not ANGLE's or the system
# provided ones. On Windows an explicit LoadLibrary("swiftshader\lib*.dll")
@@ -43,11 +43,10 @@ test("swiftshader_unittests") {
]
} else if (is_mac) {
ldflags = [
- "-Wl,-install_name,@rpath/\$ORIGIN/swiftshader",
+ "-rpath",
+ "@executable_path/",
]
} else {
- ldflags = [
- "-Wl,-rpath=\$ORIGIN/swiftshader",
- ]
+ ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ]
}
}
diff --git a/chromium/third_party/swiftshader/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2/Build/OSX/Info.plist b/chromium/third_party/swiftshader/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2/Build/OSX/Info.plist
index 459b752a2c9..eabfae578c8 100644
--- a/chromium/third_party/swiftshader/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2/Build/OSX/Info.plist
+++ b/chromium/third_party/swiftshader/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2/Build/OSX/Info.plist
@@ -11,7 +11,7 @@
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.imgtec.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>com.imgtec.$\{PRODUCT_NAME:rfc1034identifier\}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>