- 17 Apr, 2020 7 commits
-
-
David 'Digit' Turner authored
This CL adds -Wno-deprecated-copy to the CLang compile options, to avoid multiple errors with Fuchsia's Clang toolchain. Also updates the package name used to access Fuchsia libaries from FuchsiaSdk to FuchsiaLibraries. This reflects changes performed in https://fuchsia-review.googlesource.com/c/fuchsia/+/379673/ Bug: None Change-Id: Ie97a69a2bd9adaa043b3be2abdbf2e8a6dcd1936 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44017 Presubmit-Ready: David Turner <digit@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
David Turner <digit@google.com>
-
Ben Clayton authored
* changes: Update Marl to 748d3c161 Squashed 'third_party/marl/' changes from 539094011..748d3c161
-
Ben Clayton authored
LLVMReactor used to have a Big Fat Global Mutex over the entire lifetime of the Nucleus object. This was required as LLVMReactor used global variables for storing builder state. Over the past year, there has been significant code cleanup and global state has been reduced to a couple of globals that can now be marked thread_local. With all state now being immutable global or thread local, we are now able to remove the mutex. ASAN and TSAN checks for our unittests are clean. Bug: b/153803432 Change-Id: Ibe4019fb783f86e734387db431539e915369b488 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33484Tested-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Ben Clayton authored
TargetMachine have internal fields mutated during compilation. In order to support concurrent implementation, each compile needs a new TargetMachine. Bug: b/153803432 Change-Id: I1a46d8e0193e6176c777d82ce10008afca91ec94 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44013Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Ben Clayton authored
Required for making Reactor thread safe. Bug: b/153803432 Change-Id: I6d36346e22e4ba7a629e280baaa8d293969c366f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44012Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Ben Clayton authored
https://swiftshader-review.googlesource.com/c/SwiftShader/+/43693 added an assert to SpirvShader::Operand that checks the object is a constant or an intermediate. SpirvShader::Impl::Debugger::exposeVariable() was constructing an Operand for pointer object types (but was not using it), firing this assert. Bug: b/129000021 Bug: b/148401179 Change-Id: Id22a92e28b1bb16781b98979d26180b1c022db96 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44014 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
-
David 'Digit' Turner authored
This changes a CMake FATAL_ERROR message into a WARNING to allow building SwiftShader for arm64 with an LLVM backend properly. Otherwise, the CMake configuration aborts prematurely even if Subzero is not used in the final binaries. Bug: b/154080675 Change-Id: Ia9ea9896d793071c6d275864955a89a1c262c5d6 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43853 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
David Turner <digit@google.com> Presubmit-Ready: David Turner <digit@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 16 Apr, 2020 19 commits
-
-
Ben Clayton authored
Changes: 748d3c161 Add usage recommendations to README.md 2939fcfed Replace marl::parallelize() 4b4600208 Fix stupid typo in front page code samples. 742bba9c8 Fix clang-tidy and go-vet warnings. Commands: ./third_party/update-marl.sh --squash Bug: b/140546382 Change-Id: Ia8226c11bafbf40907a4622cfdfae3cdcdc303ba -
Ben Clayton authored
748d3c161 Add usage recommendations to README.md 2939fcfed Replace marl::parallelize() 4b4600208 Fix stupid typo in front page code samples. 742bba9c8 Fix clang-tidy and go-vet warnings. git-subtree-dir: third_party/marl git-subtree-split: 748d3c16165c7dcff018273cfaf9d8f26a33333a
-
Ben Clayton authored
Enable `-Wextra` and `-Wunreachable-code-loop-increment`. Disable `-Wno-unused-parameter`. Detects the build warning / breakage fixed by https://swiftshader-review.googlesource.com/c/SwiftShader/+/43989. Bug: none. Reducing chance of future build breakages. Change-Id: I3001f0ded71f2f71f817581996cc727e345845a3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43991 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
-
Ben Clayton authored
Caught with clang -Wextra. Bug: b/150155499 Change-Id: I80bdcaeb7f11954e57fd6e27d8747625eba66694 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43990 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Presubmit-Ready: Ben Clayton <bclayton@google.com>
-
David 'Digit' Turner authored
These were generated by running the LLVM CMake with a Fuchsia toolchain, from the release/10.x branch of https://github.com/ then copying the include/llvm/Config directory here. The content is exactly the same as the linux one, except for config.h due to platform differences. The generated stripped Fuchsia/x64 binary is 25 MiB (compared to 22 MiB for LLVM 7.0). git clone https://github.com/llvm/llvm-project.git --depth=1 git checkout release/10.x cd llvm-project mkdir build && cd build cmake ../llvm -DCMAKE_TOOLCHAIN_FILE=/tmp/cmake-sdk/FuchsiaSdkToolchain.cmake -GNinja ninja -j32 mkdir -p $SWIFTSHADER_DIR/third_party/llvm-10.0/configs/fuchsia/include/llvm cp -r include/llvm/Config $SWIFTSHADER_DIR/third_party/llvm-10.0/configs/fuchsia/include/llvm/ Bug: b/154082485 Change-Id: Ife30265cf77ee79f14face1f0de8e9b9f8d639b1 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43851 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
David Turner <digit@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
-
Antonio Maiorano authored
Moved the copy to bin custom command into Vulkan/CMakeLists.txt. We always copy, just like for the GL targets. Bug: b/145758253 Change-Id: Idf3af01b453e202610156eff3b302c41fb0ac292 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43974Tested-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
-
Antonio Maiorano authored
If a project that uses SwiftShader already imports the Vulkan::Headers target, and these are different from the version in SwiftShader, we fail to build because we have a static_assert to match the exact version. Replace compile-time assert with a runtime assert to make sure our code still works with different versions of the headers. This fixes Amber building against SwiftShader. Bug: b/154215163 Change-Id: I39e32370b51c702ab6d0a9790d06c31537f27472 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43973Tested-by:
Antonio Maiorano <amaiorano@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Antonio Maiorano authored
If parent project sets CMAKE_BUILD_TYPE as a non-cache variable (e.g. like https://github.com/google/amber does), CMake emits an error because we're trying to set it as a cache variable. Bug: b/145758253 Change-Id: Ie169c45dd11674be9e40610f5dd711b8fd5830f8 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43952 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Antonio Maiorano authored
Pass "-C ${SWIFTSHADER_DIR}" to the git submodule command so that it executes from the SwiftShader directory, and not CMAKE_CURRENT_SOURCE, which will be an outer directory. Also, make sure to always check if one target from the submodule already exists to allow parent projects to add their own version. Also: * Refactor submodule init code into function(InitSubmodule) * Only download libbacktrace if REACTOR_EMIT_DEBUG_INFO is enabled * Add downloads of json and cppdap if SWIFTSHADER_BUILD_CPPDAP is enabled Bug: b/145758253 Change-Id: I3bd3f3fcb7f7190f052d2e6f144468bffa0c79da Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43951 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:Ben Clayton <bclayton@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Antonio Maiorano authored
Essentially, do not assume CMAKE_SOURCE_DIR is the SwiftShader root directory. Instead, we now set SWIFTSHADER_DIR in the root CMakeLists, and use that everywhere. Bug: b/145758253 Change-Id: I4968d0dc06ebd8e45791f7cd956e5aeeefddd54f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43949 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Antonio Maiorano authored
Bug: b/145758253 Change-Id: I15f02fc3f619aac398564f4aacfd30d1dadbe5ef Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43948 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Antonio Maiorano authored
Should have done this in my previous changes. These options aren't meant to be exposed to dependee targets. This also allows us to disable/remove these options on a given target, without depender targets adding them back. Bug: b/145758253 Change-Id: Ieaba6824554d74e65d313409916bdf9ce4fd6182 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43928 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Ben Clayton authored
marl::blocking_call() calls the passed function on another thread. Attempting to unlock a mutex on a different thread that locked it is illegal. Also lock for destruction. Bug: b/140421726 Change-Id: I87226176bc3a1a454d9c79a139f4d42e51f66814 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43908Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Ben Clayton authored
Change-Id: I47b09ed307bb2cf4159b375171de0d393a017d3d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43994Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
-
Ben Clayton authored
"ProcessState contains information about an exited process, available after a call to Wait or Run" As ProcessState is only assigned after `Wait()` has completed, and this is run on another goroutine, it may be nil. Check before using it. Change-Id: I319f0703b3547186b53caca8d9d70bc5cd738d34 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43993Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
-
Ben Clayton authored
These used a static for caching the computation, but didn't use a static initializer. This meant there was a race between the check for zero and the assignment. Bug: b/153803432 Change-Id: Id5b91050ced0b8d4811eb32ffed24885816ade7a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43909Tested-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Ben Clayton authored
This will also be used by the pipelines for dynamic recompilation. Bug: b/154158882 Change-Id: I0fe16dbc3bc4eed8ffdd90afcd62f255ca8e4505 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43848 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
-
Ben Clayton authored
Fix warning raised by the compiler being too smart for its own good: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment] Bug: b/153194656 Change-Id: Idca543c13213c6e0bd2d1ff2fdbaa48348f53bf2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43989Tested-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
-
Ben Clayton authored
LRUCache previously had a complexity of O(n). Reimplement using a `std::unordered_set` and a linked list to get this reduced to O(1). Renamed `LRUCache::query()` to `LRUCache::get()`, as this is a more common verb for a cache, and the `query()` suggests it is side effect free (when it actually makes the entry MRU). Move `LRUCache.hpp` from `src/Device` to `src/System` so it can be tested by `system-unittests`. Move the logic of `LRUSnapshotCache` into `VkDevice::SamplingRoutineCache`, as this was the only place it was used, and made it exceptionally hard to separate mutex-locked data from non-locked data. This is part of the work to get our code statically thread-safe-verifiable. Bug: b/153194656 Change-Id: Ie02888ae6c7ed4066df77d692dfae28c3bc1664d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43489Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Presubmit-Ready: Ben Clayton <bclayton@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
-
- 15 Apr, 2020 5 commits
-
-
Antonio Maiorano authored
Bug: b/145758253 Change-Id: Ifc97d3f833fcf41098ed24aad9cac26f51c28df3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43870Tested-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
-
Antonio Maiorano authored
Moved out code from the root CMakeLists into new CMakeLists for each test and benchmark directory. For Reactor, both the unit test and benchmark source files are in src/Reactor, so for now, I created folders for these under tests with a CMakeLists that includes the source files from src/Reactor. This will be cleaned up eventually when we move Reactor out of src (b/154013190). Bug: b/145758253 Change-Id: Ic6bbc394e49d3bdc3105509a19458722fcfe68ee Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43868Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Ben Clayton authored
They make it unnecessarily easy to write code that violates the mutex lock requirements. Replace with the `getOrCreate` pattern already used in vk::Device, which keeps the locking internal. This change fixes a couple of places that we were accesssing data without correct locking (real bugs). Bug: b/153194656 Change-Id: I132c450594f4042160b575197789bca7f1a5e25f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43650 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Ben Clayton authored
The rules were missing the `Debug/` prefix. Bug: b/145758253 Change-Id: Ia5b9e4f162c6f685e15bf26ab492dcebc93b844d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43850Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Alexis Hetu authored
According to the Vulkan 1.2 spec: "For fixed-point depth buffers, fragment depth values are always limited to the range [0,1] by clamping after depth bias addition is performed. Fragment depth values are clamped even when the depth buffer uses a floating-point representation." So, unless the VK_EXT_depth_range_unrestricted extension is enabled, clamping should always occur. Bug: b/152634772 Change-Id: I2aee2aeb91efed7399580689fc0ffc0634b2f487 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43869 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
- 14 Apr, 2020 9 commits
-
-
Antonio Maiorano authored
Add CMakeLists.txt to the following folders under src that create the following targets: Device -> vk_device Pipeline -> vk_pipeline WSI -> vk_wsi System -> vk_system Vulkan -> vk_swiftshader Dependencies (by folder): System --> n/a Pipeline --> System Device* Vulkan* WSI --> System Pipeline Vulkan* Device --> System Pipeline Vulkan* Vulkan --> Device Pipeline WSI System * = dependency by include directory only (should fix this in the future) Also make system-unittests and system-benchmarks depend on vk_system rather than build part of System source files. Bug: b/145758253 Change-Id: I9cce59ca90d91601696f6195326b5fd7dde517d5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43690 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Ben Clayton authored
`RoutineCache` was not used, remove it. Rename `RoutineCacheT` to the now unused name `RoutineCache`. Bug: b/126126820 Change-Id: I656c1727446754b2063033806634678b14485b6f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43816Tested-by:
Ben Clayton <bclayton@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Ben Clayton authored
Prefer composition over inheritance. Makes it clear that the virtual destructors on these processors are unnecessary. Bug: b/126126820 Change-Id: I062c06191ec1cdfb81f2a2773a976bf5c596e658 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43817Tested-by:
Ben Clayton <bclayton@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
David 'Digit' Turner authored
This implements external memory using a Zircon VMO handle that can be transferred between Fuchsia processes easily. Bug: b/140419396 Change-Id: I81cecec35b218eb22f3318ddec7b790b89e5ce09 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36168Tested-by:
David Turner <digit@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The Modf and Frexp instructions from the GLSL.std.450 extended SPIR-V instruction set take a pointer argument to write one of their results to. This makes them the only arithmetic instructions which need to know how to explicitly access memory. This change replaces the partial duplication of store logic with a call to the underlying implementation of OpStore. To support storing intermediate values not associated with SPIR-V objects, the Operand class can now also wrap an independent Intermediate instance. Bug: b/153641251 Change-Id: Iebab43640b45ed6c27a77576168481d1a27158b6 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43728 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
The new Store() helper function can store Operand instances independent from SPIR-V instructions. This allows reuse of this logic for other instructions that need to store to memory, like Modf and Frexp. Bug: b/153641251 Change-Id: I453bb7cd24ba26b9a23d73568dc3374a52a36073 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43695 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
-
Nicolas Capens authored
The Operand class is a low-level abstraction of rvalues and constants. It should not carry the SPIR-V type ID. We only need the size in components. Bug: b/129000021 Change-Id: I6cb3ed6341b1ccf5ef759075d7410ba447617c8b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43693 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Bug: b/129000021 Change-Id: I36401de649eb53474ca74acb069351ce37f7529f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43828 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Avoid directly accessing SPIR-V instruction words. The helper methods provide self-explanatory semantics so we can eliminate local variables to store these IDs. Bug: b/129000021 Change-Id: Ie42782d53b9c24014b6a1b1f51b82085b6c2ebef Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43694 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-