- 09 Feb, 2021 4 commits
-
-
Nicolas Capens authored
Google Benchmark by default only measures time spent in the main thread. Since our Vulkan queue implementation executes command buffers on a separate thread, this can lead to very little "CPU" time being reported. Use MeasureProcessCPUTime() instead to use the total CPU usage of the process by all the threads: https://github.com/google/benchmark#cpu-timers Bug: b/177624844 Change-Id: I071cd31095a83a5afec51120fb78e42decda2083 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52628Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
-
Jason Macnak authored
... to allow rolling SwiftShader for Android. external/swiftshader/third_party/llvm-10.0/llvm/lib/Support/ ManagedStatic.cpp:21:30: error: unused variable 'ManagedStaticMutex' external/swiftshader/third_party/llvm-10.0/llvm/lib/Support/ ManagedStatic.cpp:22:24: error: unused variable 'mutex_init_flag' Bug: b/171498948 Test: build inside Android repo Change-Id: Idc3ab2ef4de759c14499454f5d841b750124686b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52648 Presubmit-Ready: Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Jason Macnak <natsu@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
-
Jason Macnak authored
This reverts commit 3e9b79ff. Reason for revert: Android does not allow CoW mappings to be EXEC because it assumes they are text relocations (when selinux enforcing Change-Id: I1227a2caa18bdad1a46873e4ec420a83cb21821b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52630 Presubmit-Ready: Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Jason Macnak <natsu@google.com> Tested-by:
Jason Macnak <natsu@google.com>
-
Antonio Maiorano authored
On Linux-based machines, a shared library's path may be resolved in multiple ways, such as from LD_LIBRARY_PATH. For these OSes, use dlopen to see if it exists. Note that trying to create a vk::DynamicLoader with an invalid path throws an exception, and enabling exceptions is not always possible, so we want to detect the error case beforehand. Bug: b/177624844 Change-Id: I5f27cfe485afbac0e4f6bda14eed2809669c2510 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52629Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Presubmit-Ready: Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
-
- 08 Feb, 2021 1 commit
-
-
Antonio Maiorano authored
This change moves the VulkanBenchmark and DrawBenchmark classes to VulkanWrapper so that they can be used from other unit tests -- namely, vk-unittests. In doing so, it became clear that using these as base classes wasn't great for writing googletests, as text fixtures are classes themselves, and this resulted in messy multiple inheritance. So I modified the two classes to use callback registration instead of virtual functions. Apart from reworking existing tests (e.g. see TriangleBenchmark.cpp), I also added a new DrawTests.cpp to vk-unittests with a unit test to make sure we don't crash when leaving out "gl_Position", a bug that sugoi@ fixed in swiftshader-cl/51808. This is a good example of how easy it can be to write such unit tests now. List of changes: * Moved VulkanBenchmark and DrawBenchmark to VulkanWrapper, and renamed VulkanTester and DrawTester respectively. * ClearImageBenchmark refactored to aggregate a VulkanTester. This is an example where using a class is fine as we can still use the testers via aggregation. * TriangleBenchmark tests refactored to use DrawTester and register callbacks. * Moved compute tests to a ComputeTests.cpp. * Moved the other tests to BasicTests.cpp. * Added DrawTests.cpp with new DrawTests.VertexShaderNoPositionOutput test. * CMake: add VulkanWrapper target for unittests as well as benchmarks. * CMake: change FOLDER to better organize the tests and benchmarks for VS. Bug: b/176981107 Change-Id: Ib1a0b85b3df787d2e39da08930414f9a14954a73 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52348 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
-
- 05 Feb, 2021 4 commits
-
-
Antonio Maiorano authored
Use the constexpr constructor for _MSC_VER >= 1925, otherwise ManagedStatic will have a dynamic initializer, which depending on init order, results in the Ptr field being overwritten with 0. This eventually leads to multiple instances of the same ManagedStatic instance in the StaticList, and asserts when double destroying during llvm_shutdown. I reported this bug [here](https://bugs.llvm.org/show_bug.cgi?id=49027), and learned that this bug had already been fixed in upstream LLVM. Note that llvm_subzero already has a similar change, though for _MSC_VER >= 1920. According to the LLVM comment, the VC++ compiler up until 1925 may still emit a dynamic initializer for a constexpr constructor, but I suppose we never ran into that for Subzero, so I'll leave this as is. Bug: b/175782868 Change-Id: Ice3944f67e496aa94f1a7ed7502b49e763d702b4 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52508 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
The LLVM JIT fails loudly when attempting to parse this command line option when targeting non-x86 CPUs. Bug: b/157555596 Change-Id: Ic5ddccbdbc86c2f03ded5f4004369ece0100c031 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52488 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
Fuzzing tests generate shaders with large arrays or very high numbers of local variables, which can cause stack overflow. We need to limit the allowable stack memory usage of generated routines. Note this change does not yet gracefully deal with routines which exceed this limit. They will cause a null pointer dereference instead of a stack overflow. The default stack size limit of 1 MiB at the Subzero level is to ensure we catch cases of excessive stack sizes even in the case no explicit limit was set. At the Reactor level we reduce it to 512 KiB to prevent actual stack overflow for a 1 MiB stack, assuming some earlier calls might want to use the stack. Also, our legacy 'ASM' compiler for GLSL allocates 4096 'registers' of 4 components for 128-bit SIMD, which already requires 256 KiB. Bug: b/157555596 Change-Id: I474285eecc786496edffbaef29719ca0cdf03f7d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52329 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
Fuzzing tests generate shaders with large arrays or very high numbers of local variables, which can cause stack overflow. We need to limit the allowable stack memory usage of generated routines. Note this change does not yet gracefully deal with routines which exceed this limit. They will cause a null pointer dereference instead of a stack overflow. The 512 KiB stack size limit is chosen to prevent actual stack overflow for a 1 MiB stack, assuming some earlier calls might want to use the stack. Also, our legacy 'ASM' compiler for GLSL allocates 4096 'registers' of 4 components for 128-bit SIMD, which already requires 256 KiB. Bug: b/157555596 Change-Id: I25c57420f6d2af323ce98faf515feca0aa834a4a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51548 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
-
- 03 Feb, 2021 1 commit
-
-
Yilong Li authored
This fixes the following issues when cross compiling SwiftShader for arm64 macOS using CMake: - Sets architecture based on CMAKE_OSX_ARCHITECTURES settings. - Add missing dependency to LLVM. - Add a workaround for assembly file compilation on macOS in marl. Bug: fix build Test: cmake .. -DCMAKE_OSX_ARCHITECTURES=arm64 Change-Id: I8abba9e39907d8f4d59f51c57f09cd55d4edc148 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51890 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Yilong Li <liyl@google.com> Commit-Queue: Yilong Li <liyl@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 01 Feb, 2021 3 commits
-
-
Nicolas Capens authored
These SPIR-V execution modes can be used to optimize early depth test, but are currently ignored, which is fine from a correctness point of view. We need to handle these execution modes because they can appear in any shader, without the implementation having to support using them for optimizations. Also, we can keep the SpirvShader::Modes fields that correspond to them for debugging purposes (e.g. an application might incorrectly rely on early depth test optimization to happen). Bug: b/177915067 Change-Id: I851fdfbcdde5be6287bc4ee689fdbd6549e2900f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51908 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Googler authored
VectorType::getNumElements() will be removed in LLVM 12. Only FixedVectorType will support this method. Cast to the latter where appropriate. Since LLVM 10 does not support FixedVectorType, treat it as an alias for the legacy VectorType implementation. Bug: b/354893276 Change-Id: Ie8160478819ff1c1bcd7fbe4425d2264869770e9 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52308Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Nicolas Capens authored
Clang produces: "error: code will never be executed [-Werror,-Wunreachable-code]" For code following an unconditional `break`. But it hints that: "note: silence by adding parentheses to mark code as explicitly dead" Hence the dead code can follow an "if((true)) break;" without producing the warning/error. Note that in this instance we could have just removed the dead code, but I wanted to make it clear that this is an example of an unfinished Reactor function. Bug: b/178929463 Change-Id: I1ea4dac91877fcede189d09e3953568b2813129e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52288Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 31 Jan, 2021 1 commit
-
-
Yilong Li authored
Currently, VkImages with VK_IMAGE_TILING_OPTIMAL tiling actually also have a linear texel layout in our current implementation, thus it can be sampled or used as blit source. And we would like to add support to sampling features for linear images when calling vkGetPhysicalDeviceImageFormatProperties() to query image format properties. Exceptions include images with compressed formats and images created to be used as cube maps. This will unblock SwiftShader users like AEMU/FEMU from sampling host-visible memory shared between guest processes. Bug: b/171299814 Bug: fuchsia:54153 Bug: fuchsia:68365 Test: dEQP-VK.* Change-Id: Id9019fc9d9239fc85d0d2b086d4efd468844d254 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49108 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Yilong Li <liyl@google.com> Tested-by:
Yilong Li <liyl@google.com>
-
- 30 Jan, 2021 2 commits
-
-
Nicolas Capens authored
Previously each constant would cause new memory to be allocated. This change makes us search through the existing constants to check if a suitable one already exists. Bug: b/178661423 Change-Id: I1315c80f019ff51e96245238100aa672d5e74930 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52229 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
-
Nicolas Capens authored
This enables generating multiple functions within the same scope, as excercised by the Trampoline unit test. Also adds a unit test for functions which are never finalized (useful for when a code path is not supported and we want to fall back to a C++ implementation). Also adds a unit test for the common pattern of deriving from Function<> and using Reactor variables as members. Bug: b/177999324 Change-Id: I269946e9c8a791eab84ff756c9c588ca8ce26337 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51988Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 29 Jan, 2021 2 commits
-
-
Antonio Maiorano authored
LLVM has a known leak, which is addressed by this patch: https://reviews.llvm.org/. With this patch, and making sure that llvm::shutdown() is called, AppVerifier on Windows, and LSAN on Linux, report no more load/unload leaks. Bug: b/175782868 Bug: chromium:972686 Bug: angleproject:5377 Change-Id: If34a00c3a4b845604445f22bdb5889f51bb5a1d6 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52168 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
Naming 'anonymous' mmap memory, which we use for Reactor's executable memory, enables profilers to attribute JIT-compiled routine execution to SwiftShader. Also suppress a GCC warning about not using the result of ftruncate(). Bug: b/174801963 Bug: b/178614275 Change-Id: Iac4938f332f0e75a9b1d995c83f0cbaaf3532651 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52228Tested-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 28 Jan, 2021 6 commits
-
-
Nicolas Capens authored
Naming 'anonymous' mmap memory, which we use for Reactor's executable memory, enables profilers to attribute JIT-compiled routine execution to SwiftShader. Also rename `swiftshader_reactor_private_config` to `swiftshader_llvm_reactor_private_config` to clarify that it is only used for building Reactor with the LLVM backend. Bug: b/174801963 Change-Id: I4a6cb471b00f8403978870fd0be4608ee2798e54 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52208 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
This change restricts the effect of REACTOR_ANONYMOUS_MMAP_NAME to platforms which define the __linux__ macro, since this feature makes use of mmap(), syscall(), and posix_memalign(). Note Android is considered Linux. Bug: b/174801963 Change-Id: Id194aca837b2c9c23f5c7419c926bc2872b77d1b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52209 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Alexis Hetu authored
This cl adds a new utility function to count the number of components used by an input. Bug: b/171415086 Change-Id: I348959ccd8945d2f336384cf7d905d3140231e4e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51736 Commit-Queue: Alexis Hétu <sugoi@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The sampleRateShading feature adds new builtins variables which have to be supported: BuiltInSampleId and BuiltInSamplePosition. This cl sets the values for these builtins properly and turns on per sample rendering where either of these is persent in the shader. Bug: b/171415086 Change-Id: I959e80722493d12213be349019a0cc3a108a7596 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51735Tested-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
When the shader contains interpolation instruction, interpolation related data needs to be stored in the routine in order to be able to perform the interpolation operations in the middle of running the spirv shader. Bug: b/171415086 Change-Id: I08fc6befdca1df92fa50326d9047926ac3417aa5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51734Tested-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
This cl introduces per sample shading in the fragment shader. Rather than call the fragment shader multiple times per sample, this cl adds a potential loop in the fragment shader where each sample is processes in one of the loop's iteration. - Each multisample related loop now processes either all samples, like before, or the current sample, if per sample shading is enabled - A new per sample PixelProgram::maskAny() function was added - emitEpilog() now has an option not to clear phis in order to be able to only clear them on the last sample - The routine's fragCoord values are set per sample, with the proper sample offsets - Similarly, the xxxx and yyyy values used for interpolation are now offset with the proper sample offsets when per sample shading is enabled Bug: b/171415086 Change-Id: Ibd0c1bad23e2d81f7fa97240ebb50f88f1fee36e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51733Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
- 27 Jan, 2021 1 commit
-
-
Nicolas Capens authored
Naming 'anonymous' mmap memory, which we use for Reactor's executable memory, enables profilers to attribute JIT-compiled routine execution to SwiftShader. Bug: b/174801963 Change-Id: I3b1558fb89d1cac42f65be0609cfa5ac2a8319ef Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52129Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
- 26 Jan, 2021 5 commits
-
-
Antonio Maiorano authored
* Move out VulkanBenchmark and DrawBenchmark classes to their own hpp/cpps. * Move out ClearImageBenchmark and TriangleBenchmark classes and tests to their own cpps. * Add non-template DrawBenchmark::addVertexBuffer that takes the size of the vertex type. This allows for the implementation to be moved to the cpp file, keeping the header light and easy to understand. Bug: b/176981107 Change-Id: I657bd112c5523aa56dc5617082d6744b9edac03a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52130 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
-
Alexis Hetu authored
VkPipelineMultisampleStateCreateInfo contains parameters specific to the sampleRateShading feature. This cl handles these new parameters (without enabling the sampleRateShading feature). Bug: b/171415086 Change-Id: I8e895483ab5d27643a2fc59347bb41a51570602d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51732Tested-by:
Alexis Hétu <sugoi@google.com> Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
Some of the interpolation logic is required to properly implement the GLSLstd450Interpolate* operations. In order to prevent code duplication and to make sure the logic is always identical between the regular fragment input interpolation and the one performed by the GLSLstd450Interpolate* operations, the interpolateCentroid() function was moved to SpirvShader and renamed with a more generic name, interpolateXY(), as it will be used to interpolate all modes (centroid, sample and offset). Bug: b/171415086 Change-Id: Ifbffa2b395a0b8c22fa120b36643db05f867a306 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51731Tested-by:
Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alexis Hetu authored
The sample qualifier forces the use of per sample rendering, so this cl adds a mode for it and detects whether the sample decoration is used in the shader. Bug: b/171415086 Change-Id: Ic59eb45c41f019859eff01de4bf467284de53c0a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51730Tested-by:
Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Jason Macnak authored
Bug: b/176981107 Test: build latest merge inside of Android repo Change-Id: I3b3d87ac118157d103b33afd1a885116f659662e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52128 Presubmit-Ready: Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Jason Macnak <natsu@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
-
- 25 Jan, 2021 2 commits
-
-
Antonio Maiorano authored
* Renamed TriangleBenchmark to DrawBenchmark * Added a set of hooks (virtual functions) that are invoked at certain points during execution of DrawBenchmark::init and renderFrame. These functions are prefixed with "do" to distinguish them. * Added some resource management functions in DrawBenchmark, such as addImage and addSampler for child classes to create these resources. We want these owned by the base class so that resources can be properly disposed of in the right order. * Removed enum class FragShadeType, and replaced with three classes derived from DrawBenchmark that implement the necessary hooks. * DrawBenchmark tracks the number of vertices provided via addVertexBuffer so that it can pass it to vk::CommandBuffer::draw(). Derived types can therefore provide as many (triangle) vertices as they like from doCreateVertexBuffers. Bug: b/176981107 Change-Id: I687f3d5ca09f7f93a3d6d7f68871a95bd083bf89 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52108Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Antonio Maiorano authored
Generalized TriangleBenchmark to support rendering a triangle of a solid color (hard-coded in shader), interpolated input colors, and interpolated colors with texture sampling. Added benchmark captures for each type, along with multi-sampled versions of each. Bug: b/176981107 Change-Id: Iadef1f0f9a339038198f8ef0e492c4c2909a96b2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51889Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
- 22 Jan, 2021 3 commits
-
-
Alexis Hetu authored
SwANGLE tests detected that SwiftShader's sample positions were 180 degree flipped from Vulkan's exact sample locations. Most multisampling tests we've run with SwiftShader so far relied on resolved outputs, so having the samples in the wrong order didn't matter, as long as we had the correct 4 samples (which we do, since the samples are essentially rotated by 90 degrees around the center of the pixel from each other). Bug: b/170962186 Bug: b/141380498 Change-Id: I65552863e1fe38b321b84995e038984488512e1c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52088Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Nicolas Capens authored
The first devices with M1 'Apple Silicon' AArch64 processors were launched with macOS 11.0, so it's safe to increase the target OS beyond the 10.11 support level needed by Chrome. This helps enable C++17 by addressing the lack of aligned heap allocation support in previous macOS versions: third_party/marl/include/marl/pool.h:236:27: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer src/Vulkan/VkPipeline.hpp:83:10: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer C++17 invokes aligned new/delete because of our use of alignas(16) for types like sw::float4, which is used for member fields in sw::DrawCall::BatchData and vk::GraphicsState. While this could be addressed by using custom new/delete operators for these classes (and classes which in turn use them as members), misalignment is just a minor performance issue, so we can leave things as-is and work around it with a build flag (note 16-byte alignment is needed for some vectors accessed in Reactor code, but that's handled for those individual cases). Bug: b/174843857 Change-Id: Iaa40a3ac6aa7d12c088bf93a55803d8146bd289c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52068Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
-
Ben Clayton authored
* changes: Update src/Pipeline/SpirvShaderInstructions.inl Update SPIR-V Tools to f37547c73 Squashed 'third_party/SPIRV-Tools/' changes from b0e22d28f5e..f37547c73a9 Update SPIR-V Headers to 8bb2420b4 Squashed 'third_party/SPIRV-Headers/' changes from 104ecc356c1..8bb2420b44a Mend git merge history for SPIRV-Headers and SPIRV-Tools Mend git merge history for SPIRV-Headers and SPIRV-Tools Revert 9dff6a3b to mend git merge history for SPIRV-Headers and SPIRV-Tools Squashed 'third_party/SPIRV-Tools/' changes from a61d07a7276..b0e22d28f5e Squashed 'third_party/SPIRV-Headers/' changes from 7845730cab6..104ecc356c1
-
- 21 Jan, 2021 5 commits
-
-
Ben Clayton authored
for SPIRV-Tools update Bug: b/123642959 Change-Id: I6c21b03ddb5f04e20fb72c0e6b280ca9caaf1f7b
-
Ben Clayton authored
Changes: f37547c73a9 spirv-val: Add Vulkan EXT builtins (#4115) 1bd539b9bfc Support pending Intel extensions (#4116) 56f8ed48efd Validate Sampled=1 for Vulkan ImageQuerySizeLod, ImageQueryLevels, ImageQueryLod (#4103) e25db023c47 spirv-val: Add Vulkan Memory Scope VUs (#4106) 8383bd5d6f2 Migrate all Kokoro build scripts over to use the docker VM image (#4114) ee39b5db5f1 spirv-val: Add Vulkan Addressing Model check (#4107) 9150cd441f4 Remove WebGPU support (#4108) b2cfc5d1cec spirv-val: Vulkan atomic storage class (#4079) cec658c1160 Avoid integrity check failures caused by propagating line instructions (#4096) b1507d0d2ba Linker usability improvements (#4084) 7bbe1a31641 Revert "Generate differentiated error codes for buffer oob checking (#4097)" (#4100) c32277c0ba0 Generate differentiated error codes for buffer oob checking (#4097) f3ccb633dfd use std::string::empty() to test for emptiness (#4098) ad77ed7a8d5 spirv-val: Label standalone Vulkan VUID (#4091) aa005e8bd43 spirv-val: Add Vulkan decroation VUID (#4090) 4ed1f4fce9e Fix binding number calculation in desc sroa (#4095) af3a3d481f6 Build deps: dump ini from 1.3.5 to 1.3.7 in tools/sva (#4092) 94d1a80159e spirv-val: Add Vulkan FP Mode VUID (#4088) 6d05ed8410b spirv-val: Fix Vulkan image sampled check (#4085) 37c03859de9 spirv-val: Add Vulkan ForwardPointer VUID (#4089) d630e5f8c10 spirv-val: Add Vulkan ImageTexelPointer format check (#4087) 1bb80d2778a spirv-val: Add Vulkan Group Operation VUID (#4086) 17ffa89097b spirv-val: Add first StandAlone VUID 04633 (#4077) 8f4b35c332e spirv-val: Add Subgroup VUIDs (#4074) 4e31fdd4aa1 spirv-fuzz: Fix OpPhi handling in DuplicateRegionWithSelection (#4065) ad898cb9498 validation: validate return type of OpImageRead (#4072) 305caff2ebb validation: tighter validation of multisampled images (#4059) a0370efd589 validate OpTypeImage Sampled values for environemnts (#4064) 09d1fea5890 Force using Python 3 git-sync-deps (#4067) 7170218b8de validate StorageImageMultisampled capability (#4062) 3b85234542c spirv-val: Add last TessLevelOuter and TessLevelInner VUID (#4055) 171290703a6 spirv-val: Add last ClipDistance and CullDistance VUID (#4054) 1a6b4053fa0 spirv-val: Add last ViewportIndex and Layer VUID (#4053) 9df5225e672 spirv-val: Add last Position VUID (#4052) 862d44a86ed Allow forward pointer to be used in types generally (#4044) bda102d7a76 opt: Run DCE when SPV_KHR_shader_clock is used (#4049) b27b1afd12d Update CHANGES to include latest ray tacing fixes. cd050786621 Take new (raytracing) termination instructions into account. (#4050) 21f7c5675da Start SPIRV-Tools v2020.7 4c2f34a5048 Finalize SPIRV-Tools v2020.6 c9c1f54330d Update CHANGES 10e0ae7946c Do run DCE if SPV_KHR_ray_query is used. (#4047) 84546647a0d Update CHANGES c1d5a045f6f Change ref_analysis to RefAnalysis to follow coding standards. (#4045) c502a15f25c Handle 8-bit index in elim dead member (#4043) 32573bb2168 Add validation support for the ray tracing built-in variables (#4041) 7046c05d2fb Add texel buffer out-of-bounds checking instrumentation (#4038) cf2d1e7afcd Update spirv-header deps (#4040) 1299436c8f1 Reject SPIR-V that applies void to OpUndef, OpCopyObject, OpPhi (#4036) 2c458414c08 BuildModule: optionally avoid adding new OpLine instructions (#4033) a79aa038ec1 Remove prototype for unimplemented method (#4031) Commands: ./third_party/update-spirvtools.sh Bug: b/123642959 Change-Id: Ic6136d02f11f153a36ab9b9bb8019b4b18b3b5f3 -
Ben Clayton authored
f37547c73a9 spirv-val: Add Vulkan EXT builtins (#4115) 1bd539b9bfc Support pending Intel extensions (#4116) 56f8ed48efd Validate Sampled=1 for Vulkan ImageQuerySizeLod, ImageQueryLevels, ImageQueryLod (#4103) e25db023c47 spirv-val: Add Vulkan Memory Scope VUs (#4106) 8383bd5d6f2 Migrate all Kokoro build scripts over to use the docker VM image (#4114) ee39b5db5f1 spirv-val: Add Vulkan Addressing Model check (#4107) 9150cd441f4 Remove WebGPU support (#4108) b2cfc5d1cec spirv-val: Vulkan atomic storage class (#4079) cec658c1160 Avoid integrity check failures caused by propagating line instructions (#4096) b1507d0d2ba Linker usability improvements (#4084) 7bbe1a31641 Revert "Generate differentiated error codes for buffer oob checking (#4097)" (#4100) c32277c0ba0 Generate differentiated error codes for buffer oob checking (#4097) f3ccb633dfd use std::string::empty() to test for emptiness (#4098) ad77ed7a8d5 spirv-val: Label standalone Vulkan VUID (#4091) aa005e8bd43 spirv-val: Add Vulkan decroation VUID (#4090) 4ed1f4fce9e Fix binding number calculation in desc sroa (#4095) af3a3d481f6 Build deps: dump ini from 1.3.5 to 1.3.7 in tools/sva (#4092) 94d1a80159e spirv-val: Add Vulkan FP Mode VUID (#4088) 6d05ed8410b spirv-val: Fix Vulkan image sampled check (#4085) 37c03859de9 spirv-val: Add Vulkan ForwardPointer VUID (#4089) d630e5f8c10 spirv-val: Add Vulkan ImageTexelPointer format check (#4087) 1bb80d2778a spirv-val: Add Vulkan Group Operation VUID (#4086) 17ffa89097b spirv-val: Add first StandAlone VUID 04633 (#4077) 8f4b35c332e spirv-val: Add Subgroup VUIDs (#4074) 4e31fdd4aa1 spirv-fuzz: Fix OpPhi handling in DuplicateRegionWithSelection (#4065) ad898cb9498 validation: validate return type of OpImageRead (#4072) 305caff2ebb validation: tighter validation of multisampled images (#4059) a0370efd589 validate OpTypeImage Sampled values for environemnts (#4064) 09d1fea5890 Force using Python 3 git-sync-deps (#4067) 7170218b8de validate StorageImageMultisampled capability (#4062) 3b85234542c spirv-val: Add last TessLevelOuter and TessLevelInner VUID (#4055) 171290703a6 spirv-val: Add last ClipDistance and CullDistance VUID (#4054) 1a6b4053fa0 spirv-val: Add last ViewportIndex and Layer VUID (#4053) 9df5225e672 spirv-val: Add last Position VUID (#4052) 862d44a86ed Allow forward pointer to be used in types generally (#4044) bda102d7a76 opt: Run DCE when SPV_KHR_shader_clock is used (#4049) b27b1afd12d Update CHANGES to include latest ray tacing fixes. cd050786621 Take new (raytracing) termination instructions into account. (#4050) 21f7c5675da Start SPIRV-Tools v2020.7 4c2f34a5048 Finalize SPIRV-Tools v2020.6 c9c1f54330d Update CHANGES 10e0ae7946c Do run DCE if SPV_KHR_ray_query is used. (#4047) 84546647a0d Update CHANGES c1d5a045f6f Change ref_analysis to RefAnalysis to follow coding standards. (#4045) c502a15f25c Handle 8-bit index in elim dead member (#4043) 32573bb2168 Add validation support for the ray tracing built-in variables (#4041) 7046c05d2fb Add texel buffer out-of-bounds checking instrumentation (#4038) cf2d1e7afcd Update spirv-header deps (#4040) 1299436c8f1 Reject SPIR-V that applies void to OpUndef, OpCopyObject, OpPhi (#4036) 2c458414c08 BuildModule: optionally avoid adding new OpLine instructions (#4033) a79aa038ec1 Remove prototype for unimplemented method (#4031) git-subtree-dir: third_party/SPIRV-Tools git-subtree-split: f37547c73a981bcf3f8b1a471e3000e606dd41a8
-
Ben Clayton authored
Changes: 8bb2420b44a Merge pull request #176 from MrSidims/private/MrSidims/OtherExtensions 0dd29fb93ac Apply suggestions to Intel extensions PR b690b3e2174 Update generated files f9797ef9c1b Add SPV_INTEL_long_constant_composite extension 8987518da9e Add SPV_INTEL_loop_fuse extension 3fad4b35436 Add SPV_INTEL_fpga_cluster_attributes and SPV_INTEL_fp_fast_math_mode b6be746fc77 Update SPV_INTEL_fpga_loop_controls extension ad00ca3b55b Update SPV_INTEL_kernel_attributes extension 0c290562414 Update SPV_INTEL_function_pointers extension ea791133ee4 Upstream SPV_INTEL_float_controls2 extension 24e9c63e6dd Upstream SPV_INTEL_vector_compute extension 2b76471587f Upstream SPV_INTEL_fpga_memory_accesses extension 0e756817218 Upstream SPV_INTEL_io_pipes extension ef87dd18967 Upstream SPV_INTEL_variable_length_array extension e202eb89141 Upstream SPV_INTEL_usm_storage_classes extension a001134e417 Upstream SPV_INTEL_arbitrary_precision_integers extensions 7669e05273b Upstream SPV_INTEL_inline_assembly extension d5035de3d31 Upstream SPV_INTEL_fpga_buffer_location extension f027d53ded7 Merge pull request #184 from dgkoch/dkoch_remove_hittkhr bdd2aa34c45 remove HitTKHR Commands: ./third_party/update-spirvheaders.sh Bug: b/123642959 Change-Id: I21d11818df5a17704b930408b509f1ca3cfdefbc -
Ben Clayton authored
8bb2420b44a Merge pull request #176 from MrSidims/private/MrSidims/OtherExtensions 0dd29fb93ac Apply suggestions to Intel extensions PR b690b3e2174 Update generated files f9797ef9c1b Add SPV_INTEL_long_constant_composite extension 8987518da9e Add SPV_INTEL_loop_fuse extension 3fad4b35436 Add SPV_INTEL_fpga_cluster_attributes and SPV_INTEL_fp_fast_math_mode b6be746fc77 Update SPV_INTEL_fpga_loop_controls extension ad00ca3b55b Update SPV_INTEL_kernel_attributes extension 0c290562414 Update SPV_INTEL_function_pointers extension ea791133ee4 Upstream SPV_INTEL_float_controls2 extension 24e9c63e6dd Upstream SPV_INTEL_vector_compute extension 2b76471587f Upstream SPV_INTEL_fpga_memory_accesses extension 0e756817218 Upstream SPV_INTEL_io_pipes extension ef87dd18967 Upstream SPV_INTEL_variable_length_array extension e202eb89141 Upstream SPV_INTEL_usm_storage_classes extension a001134e417 Upstream SPV_INTEL_arbitrary_precision_integers extensions 7669e05273b Upstream SPV_INTEL_inline_assembly extension d5035de3d31 Upstream SPV_INTEL_fpga_buffer_location extension f027d53ded7 Merge pull request #184 from dgkoch/dkoch_remove_hittkhr bdd2aa34c45 remove HitTKHR git-subtree-dir: third_party/SPIRV-Headers git-subtree-split: 8bb2420b44af3c514480e63ac24439044706b583
-