- 22 Feb, 2021 1 commit
-
-
Nicolas Capens authored
For loads following stores in the same basic block, replace their result with the data that was stored. It transforms the output of the StoresInMultipleBlocks test from: sub rsp,38h mov dword ptr [rsp],0Dh cmp ecx,0 je a mov dword ptr [rsp],4 add dword ptr [rsp],3 b: mov eax,dword ptr [rsp] add rsp,38h ret a: mov dword ptr [rsp],6 add dword ptr [rsp],5 jmp b Into: sub rsp,38h mov dword ptr [rsp],0Dh cmp ecx,0 je a mov dword ptr [rsp],4 mov eax,4 add eax,3 mov dword ptr [rsp],eax b: mov eax,dword ptr [rsp] add rsp,38h ret a: mov dword ptr [rsp],6 mov eax,6 add eax,5 mov dword ptr [rsp],eax jmp b While at first this might seem like a regression, note that `add [rsp],3` performs both a load and a store. The optimization pass eliminated two load operations from this test. The redundant stores will be eliminated by a subsequent change. Also adds a unit test for the case where store-to-load propagation should not be performed due to an indirect store through a pointer happening in between. Bug: b/179668593 Change-Id: I6ca133ac4e77bbbc3efd517dff6e8dee6d2dc147 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52533 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 20 Feb, 2021 4 commits
-
-
Nicolas Capens authored
Previously we would append the 'begin' basic block with the conditional branch only once we know whether or not there's a 'false' block separate from the 'end' block (namely when executing the Else statement). We can instead treat the 'false' block as the 'end' block itself when no Else is encountered and simply continue emitting instructions in this block. Note this removes the need to explicitly materialize all variables, because that's taken care of by createCondBr(). Bug: b/180131694 Change-Id: I5c5c4373d1dc02991feffa69d4089b2c12054dc0 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52988 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Materializing all variables should be done prior to actual branches, not when changing the insert point. The only reason we did it in the latter too was due to changing insert point before creating the branch for an If statement. Bug: b/180131694 Change-Id: Ic755bf07a098bda4af7e4d5a7d22138bee37d0c6 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52968Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
This change implements the Scalar Replacement of Aggregates (SRoA) optimization. Since Reactor only supports array aggregates, this replaces arrays which are only indexed by static indices with individual variables for each element. The ReactorArray test is optimized from: sub rsp,38h mov dword ptr [rsp],1 mov dword ptr [rsp+4],2 mov eax,dword ptr [rsp] mov ecx,dword ptr [rsp+4] mov dword ptr [rsp],ecx mov dword ptr [rsp+4],eax mov eax,dword ptr [rsp+4] add eax,dword ptr [rsp] add rsp,38h ret Into: sub rsp,20h mov eax,2 add eax,1 add rsp,20h ret Which is identical to the CArray test's generated code. Bug: b/179279298 Change-Id: Ie45261f2ac783bdc22fee06adf03ebd588f3ebc3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52428 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
This change adds a callback mechanism to report how many instructions of certain types are left after the optimization passes have been run. This enables unit tests to check that the desired optimization actually took place, instead of just checking correct execution results. Bug: b/180665600 Change-Id: I3916d327138516a0a0778be2b3fdd5b000fc9bdb Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52989 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 19 Feb, 2021 8 commits
-
-
Nicolas Capens authored
x86-64 does not support 64-bit immediates as absolute memory addresses. They have to be stored in a register, which can then be used as [base]. Previously we addressed this at the SubzeroReactor level by emitting a Bitcast from an Ice::Operand to an Ice::Variable, for which Subzero already supported 64-bit constants as input. This change implements X86OperandMem creation from a 64-bit constant operand by letting legalize() move it into a GPR and using it as the memory operand's base register. A Reactor unit test is added to exercise this. Another issue was that doLoadOpt() assumed all load instructions are candidates for fusing into a subsequent instruction which takes the result of the load. This isn't true when for 64-bit constant addresses an instruction to copy it into a register is inserted. For now this case is simply skipped. A future optimization could adjust the iterators properly so the load from [base] can be fused with the next instruction. Lastly, it is possible for a 64-bit constant to fit within a 32-bit immediate, in which case legalize() by default does not perform the copy into a GPR (note this is to allow moves and calls with 64-bit immediates, where they are legal), and simply returns the 64-bit constant. So we must not allow legalization to an immediate in this case. Note that while we could replace it with a 32-bit constant, it's rare for absolute addresses to fit in this range, and it would be non-deterministic which path is taken, so for consistency we don't perform this optimization. Bug: b/148272103 Change-Id: I5fcfa971dc93f2307202ee11619e84c65fe46188 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52768Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
SwiftShader has no use for this since shader execution with robustness features enabled can not access memory outside of the graphics resources. For Chromium it also runs in the GPU process, which isolates it from browser-wide and even tab renderer data and code, and also has its own sandboxing. If we ever do need randomization to prevent attacks, and project Bunker doesn't provide the needed site isolation, it should be implemented either at the Reactor level or as separate transformation passes where possible. While previously this feature was already disabled, there might have been inadvertent randomization which could explain our test time variability. It may also improve code generation performance a bit to not have this code around any more. Bug: b/179832693 Change-Id: If1ccb54981edb61f443dd5949c56b75bab07c7c2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52808 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Antonio Maiorano authored
When vkGetPhysicalDeviceSurfaceCapabilitiesKHR is called, we now return VK_ERROR_SURFACE_LOST_KHR on Windows if the window handle (hwnd) is no longer valid. The assert was being tripped by Chromium's compositor_unittests for test LayerWithRealCompositorTest.BackgroundBlur. With this fix, instead of an assert, the test now fails because eglQuerySurface fails with EGL_BAD_SURFACE. Bug: chromium:1174372 Change-Id: I71164c30bddaa41753472389e996cebbff7fbf77 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52928Tested-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>
-
Sean Risser authored
SPV_ENV_Vulkan_1_2 denotes support for all SPIR-V versions that are core in Vulkan 1.2. This includes 1.4 and 1.5. Tests: dEQP-VK.* Bug: b/173046235 Change-Id: I7482d1bff6bf3b2c2291538517f6640647ab644c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50670Tested-by:
Sean Risser <srisser@google.com> Commit-Queue: Sean Risser <srisser@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Antonio Maiorano authored
Rather than assume success, allow WSI surface implementations to return a VkResult for getSurfaceCapabilities. Also, made VkSurfaceKHR::getSurfaceCapabilities pure virtual, and moved its implementation to a protected static helper named setCommonSurfaceCapabilities. Bug: chromium:1174372 Change-Id: I75f5f5a30f786f0675d830e4e2a684a4cbcb149c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53048 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>
-
Alistair Delva authored
We have fixed the original problem requiring the revert. This reverts commit ed7c4d5c. Bug: b/171498948 Change-Id: I02afbf9df677f6b691d0929a1f577ff355ef08e8 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52668Reviewed-by:
Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Jason Macnak <natsu@google.com> Presubmit-Ready: Jason Macnak <natsu@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
-
Nicolas Capens authored
Optimizer::eliminateLoadsFollowingSingleStore() was only looking at a single instruction following the store. Subzero derives Ice::Inst from llvm::ilist_node<Inst>, making it a node in a circular linked list. However, we can't iterate until the end because by default ilist_node<> does not provide sentinel node tracking. If the llvm::ilist_node<Inst, llvm::ilist_sentinel_tracking<true>> class is used instead, we can use isSentinel(), but this comes at the cost of each node itself having to indicate whether it's the sentinel, and keeping that up to date. This change instead obtains the basic block's instruction list from the store instruction, to get the iterator of the end node. Bug: b/179668593 Change-Id: I994a7b37d8872380d2668c098d85000120d3e47a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52753 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
Pointers to the base address of arrays often get stored and then loaded multiple time. This change adds an optimization pass to replace these loads with the result of the alloca of the array, and eliminates the allocas of the pointer variables. The PropagateAlloca unit test without this optimization produces: sub rsp,38h mov dword ptr [rsp+8],16h cmp ecx,0 je 000002543C4E407E lea rax,[rsp+8] mov qword ptr [rsp],rax mov rax,qword ptr [rsp] mov eax,dword ptr [rax] add rsp,38h ret With the optimization pass it becomes: sub rsp,38h mov dword ptr [rsp],16h cmp ecx,0 jne 0000015DC3B33074 mov eax,dword ptr [rsp] add rsp,38h ret Also add a couple of unit tests for corner cases where the propagation is not safe to perform. Bug: b/179279298 Change-Id: I784899319bf5360f47c6fbc22fb82134d135dbfc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52468 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 18 Feb, 2021 7 commits
-
-
Nicolas Capens authored
These cases were discovered through various attempts to elide more loads and stores after a branch has already occurred. Also implement operator!= for Pointer<T>, and remove the redundant Nucleus:createPtrEQ() which both LLVM and Subzero support through integer value comparison. Bug: b/180131694 Change-Id: I27c86b4fcbe6e1740801e40cb6877629f01d6540 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52929 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Nicolas Capens authored
Prior to supporting MemorySanitizer instrumentation of Reactor routines, false positives in C++ code were avoided by marking all memory that was written to by the Reactor routines as unpoisoned. Now this can be disabled to avoid false negatives, i.e. uses of uninitialized data either in the Reactor routine or originating from it. REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION controls whether we get the new behavior or the old unpoisoning. Bug: b/155148722 Change-Id: Ia35e3cdc1a60ba44045869884c64e9875c030291 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49889 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Antonio Maiorano authored
Bug: b/180494886 Change-Id: Ib1ddebce8a5679af46a4c8457373f66289df03e7 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52909Tested-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>
-
SwiftShader Regression Bot authored
Reactor backend: Subzero Change-Id: I9cd7e38e7596554bc34bc5e2f7884d72fcd87153 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52948 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
Antonio Maiorano authored
In DEBUG builds, enable validation layers: VK_LAYER_KHRONOS_validation and VK_LAYER_LUNARG_standard_validation. Also register the debug utils messenger ext callback for when validation layers report a problem. We can force validation layers in non-DEBUG by defining ENABLE_VALIDATION_LAYERS to 1. In order to be able to use validation layers, load the Vulkan driver via ICD, rather than directly. To load SwiftShader, generate a temp icd.json file pointing at the driver path, and temporarily set the VK_ICD_FILENAMES env var to point at it when we load the ICD. This also allows us to load the native GPU driver by defining LOAD_NATIVE_DRIVER to 1 (default is 0). Fixed errors reported by enabling validation layers: * TriangleSampleTexture had a mismatched binding number for the sampler2D * Correctly set memoryTypeIndex for allocations instead of 0 Bug: b/176981107 Change-Id: I3c791086acea048b73d3568d6d7a45d8e0100c17 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52749 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
These structures were zero-initialized to work around MSan false- positives. Now that Reactor routines can be instrumented, we can omit the initialization and detect whether they are properly set by the normal code paths. Bug: b/155148722 Change-Id: Ic1136f08b5203531ffc2eda15e7d64d7c2a0d8c5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49890 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
-
SwiftShader Regression Bot authored
Reactor backend: Subzero Change-Id: I9c575df6ff7bfc61350140655fa3398d4bafab60 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52848 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
- 17 Feb, 2021 3 commits
-
-
Alexis Hetu authored
When using push constants, we end up having dynamic offsets on the input parameter of the interpolation functions, so we need to be able to handle this case. Since this is for push constants, we assume that all dynamic offsets will be the same, for simplicity. Bug: b/171415086 Change-Id: I5de1720e383c234c9392421d507a66e6d7ba2445 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52930 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com>
-
Adlai Holler authored
The Skia GPU MSAN bot runs >9 hours with this option set and had to be disabled. We'd like to get test MSAN coverage for the rest of Skia GPU and turn the bot back on, but need this option. Change-Id: I1536912e9cfe35c294e750fcd4a1f515209989bc Bug: b/155148722 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52908 Presubmit-Ready: Adlai Holler <adlai@google.com> Tested-by:
Adlai Holler <adlai@google.com> Commit-Queue: Adlai Holler <adlai@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Alistair Delva authored
Using a memfd name to annotate swiftshader_jit allocations is quite clever, but it doesn't work on Android because memfds can be shared and so writing to mappings of them promotes CoW/shared, which is classified by selinux as 'execmod' permission. Android prohibits 'execmod' permission for new app processes, because this is usually a sign the app relies on shared text relocations, which are insecure. In this case, that isn't actually happening, but we are subject to the same blanket ban :) Fortunately, Android has a longtime non-upstreamed prctl() to allow private mappings to be named as well, PR_SET_VMA_ANON_NAME. As this isn't generally available for Linux, wrap it in checks for __ANDROID__. This enables the naming without tripping the 'execmod' permission check. Bug: b/171498948 Bug: b/174801963 Change-Id: Ic4375bc4407e21ecdafb42a7cec651dc3b2ad13e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52669Reviewed-by:
Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Jason Macnak <natsu@google.com> Tested-by:
Jason Macnak <natsu@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
-
- 16 Feb, 2021 5 commits
-
-
Gavin Mak authored
Bug: chromium:1113033 Change-Id: If878e7dfc9b2e1c54f7926f9d1a9af56c5bb5515 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52548 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
-
Antonio Maiorano authored
[XLA:CPU] Remove uses of deprecated CreateAlignedLoad/Store builders These are being removed in https://github.com/llvm/llvm-project/commit/f515ca8995ce3695c6e92d83ffca2012dc753bb3 Upstreaming original change made by Alexander Kornienko (alexfh@google.com) Bug: none Change-Id: I1b1553308cc40c7e99508fb5e3999e16049a8884 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52868 Presubmit-Ready: 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> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
-
Alexis Hetu authored
This cl enables the sampleRateShading feature. New test failures caused by enabling sampleRateShading: Tests: dEQP-VK.glsl.builtin_var.fragdepth.* List of affected tests now passing: Tests: dEQP-VK.glsl.builtin_var.fragcoord_msaa.* Tests: dEQP-VK.pipeline.multisample.min_sample_shading.*.samples_4.* Tests: dEQP-VK.pipeline.multisample.mixed_count.* Tests: dEQP-VK.pipeline.multisample.variable_rate.* Tests: dEQP-VK.pipeline.multisample_interpolation.*.samples_4 Tests: dEQP-VK.pipeline.multisample_interpolation.sample_interpolate_at_single_sample.*.samples_1 Tests: dEQP-VK.pipeline.multisample_shader_builtin.*.samples_4 Tests: dEQP-VK.pipeline.multisample_shader_builtin.write_sample_mask.* Tests: dEQP-VK.renderpass.suballocation.sampleread.numsamples_4.* Tests: dEQP-VK.renderpass2.suballocation.sampleread.numsamples_4.* Bug: b/171415086 Change-Id: I1aa50cff9e2fada482ceef594c59641c7243b563 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51469 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Antonio Maiorano authored
We explicitly call Driver::unload, but so does the dtor. We just needed to clear the dll member after unloading. Bug: b/177624844 Change-Id: If587df197c2e6242892e41e715885a92167730a7 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52752 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
Antonio Maiorano authored
I implemented this extension as part of swiftshader-cl/51589 but had not exposed it as a supported extension. This worked fine when loading SwiftShader directly, but I need to now load it via the loader. Bug: b/176981107 Change-Id: I494be7154b04186e51ee380e16b60b88ff9c9d30 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52751Tested-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Result: Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
-
- 12 Feb, 2021 2 commits
-
-
Sean Risser authored
Vulkan 1.2 added VkPhysicalDeviceVulkan11Properties, which allows users to query support for several other device properties all together. We can use templated static functions to make sure these properties are only ever set in one place, similar to what we do for device features. The only struct this doesn't work for is VkPhysicalDeviceSubgroupProperties, because the names in that struct and the Vulkan11 struct differ. So the Vulkan11 struct manually copies the data from the getProperties(*) function for the subgroup properties. Bug: b/176248217 Change-Id: I30e9e05ecbdb9a40fc3a59df6bd9b8ab9022c9fc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51388Tested-by:
Sean Risser <srisser@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Commit-Queue: Sean Risser <srisser@google.com>
-
Alexis Hetu authored
This cl adds an implementation for: - GLSLstd450InterpolateAtCentroid - GLSLstd450InterpolateAtSample - GLSLstd450InterpolateAtOffset These functions essentially replicate the behavior of regular interpolants in the fragment shader processing. A specific extra difficulty encountered here is detecting which kind of pointer offset we are dealing with. Pointer offsets might be caused by [] operators being used on a vector or on an array (possibly an array of vectors). This distinction is important as it impacts what interpolant offsets point to. Note that there's missing coverage in dEQP-VK for interpolant arrays and this was caught with SwANGLE tests (a dEQP-VK issue will be logged shortly). Another issue was dealing with dynamic interpolant offsets, which was solved by looping over all of them and combining all plane equations into one before performing the interpolation. Bug: b/171415086 Change-Id: Id7c4c931918ba172d00da84655051445b110d3a9 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51737 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-
- 10 Feb, 2021 6 commits
-
-
Nicolas Capens authored
Load and store instructions, as well as intrinsics which access memory, can now shared the same methods for accessing the memory address and data operands. Note that while this change introduces the potential for non-load/store instructions to have their operands accessed through getLoadAddress(), getStoreAddress(), or getData(), that risk isn't any greater than using the wrong getSrc() index, and would stick out as a mistake much more clearly. The advantage this change brings is that we no longer have to remember where the address and data operands are stored in sub-vector load/store intrinsics. In addition, there are no more overly verbose casts, and their cost is eliminated. Bug: b/179497998 Change-Id: I0d9208555e00b0d3053f7d3baca241fef2b8cbeb Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52531 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
There were InstLoad::getSourceAddress() and InstStore::getAddr() methods, which aren't very clear and consistently named. This change replaces them with getLoadAddress() and getStoreAddress(), respectively. This will also enable moving these methods to the Inst class to make them available for SubVectorLoad and SubVectorStore intrinsics. While these methods don't make sense for other instructions, note that Inst::getSrc() already provides access to all operands and has to be used with knowledge of the operand meaning and layout. So this only provides a name to these operands, and it would stick out as a sore thumb if used incorrectly. Bug: b/179497998 Change-Id: I86b1201b8a1c611682f4f91541bdb49e17ef71a8 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52530 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
It is no longer derived from InstCall, and doesn't take a Target parameter which could be a symbol to a function which implements the intrinsic. Note one can still emit actual Call instructions if a function call is needed. Since the previous change which removed the Target parameter we can no longer decide between implementing an intrinsic as inline instructions or a function call at the Subzero level, but we can still do that at the Reactor level which has its own concept of intrinsics. This change also removes mentions of intrinsics representing function calls. It also removes code related to PNaCl-specific LLVM intrinsics, including the ability to look up intrinsics by name. The addArg(), getArg(), and getNumArgs() methods, adopted from InstCall (but no longer inherited from it), are kept for now due to risk of replacing the ones for InstCall objects, while the confusion caused by keeping the function-related "arg" term is deemed low. Bug: b/179497998 Change-Id: I293f039853abff6f5bebda1b714774205bdec846 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52608 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
Nicolas Capens authored
It is no longer used now that profiling support at the Subzero level is eliminated. This change adjusts all of the uses of getSrc() on intrinsics to obtain the correct operand, but does not yet make simplifications based on having them align with load/store instructions. Bug: b/179497998 Change-Id: I93705eaa1b7626184f612ab3a9755048004e531f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52529 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
We're never used this functionality, and shouldn't have a need for it. Profiling information can be collected at the Reactor level or using a profiler like VTune. This functionality was the only thing using the `Target` parameter of `InstIntrinsicCall`, which get in the way for aligning the parameters of load- and store-like intrinsics with regular `InstLoad` and `InstStore`. Bug: b/179497998 Change-Id: I5a0ad5ee8e0101f0879a97a1ea01e3efc5bebbe4 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52528 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
The legacy OpenGL ES implementation is deprecated in favor of SwANGLE, and we haven't touched the GLES code in many months. These CI tests consume valuable time, and tend to be flaky due to exhausting the number of X handles. We still have our 'daily' test runs to provide detection of regressions, so they can be safely removed from the CI test runs. Note that this change can also be (temporarily) reverted as part of a new change which could use CI testing of dEQP-GLES. Bug: b/153322216 Change-Id: I52cd2b89c04c95de486d85118edef6460ba82925 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52532 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
-
- 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>
-