OSDN Git Service

android-x86/external-swiftshader.git
5 years agoDisable surface and swapchain support for Android pie-x86 android-x86-9.0-r1 android-x86-9.0-r2
Chris Forbes [Fri, 5 Apr 2019 15:25:18 +0000 (08:25 -0700)]
Disable surface and swapchain support for Android

On Android we will expose ANDROID_native_buffer instead, and leave the
surface and swapchain support to the android loader.

Bug: b/122837488
Change-Id: I03f0fd617042f49c19227701bbdcd2ccda883c94
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28408
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSupport pNext chain entries in vkCreateImageView
Alexis Hetu [Fri, 5 Apr 2019 20:34:38 +0000 (16:34 -0400)]
Support pNext chain entries in vkCreateImageView

Added support for these structures in vkCreateImageView:
VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR
VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO

These only add validation without modifying imageView behavior.

This should affect a few thousand tests, which now hit the next
UNIMPLEMENTED() call, inside the SPIR-V compiler.

Bug b/119620767

Change-Id: Icd2f9608d6b9ca1500ada8e51621c8d54ff9cd8d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28429
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSample location properly marked as unsupported
Alexis Hetu [Fri, 5 Apr 2019 17:19:46 +0000 (13:19 -0400)]
Sample location properly marked as unsupported

VK_EXT_sample_locations is not supported in SwiftShader, but all
related tests were being marked as unimplemented because
vkGetPhysicalDeviceProperties2 didn't handle
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT.
Explicitly ignored this case (with a proper verification that
VK_EXT_sample_locations is indeed marked as unsupported).

Bug b/117974925

Change-Id: I64a8540c0c30599c8a0a56ce322c563918ba2c31
Tests: dEQP-VK.pipeline.multisample.sample_locations_ext.*
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28428
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoInput aspect support in vkCreateRenderPass
Alexis Hetu [Fri, 5 Apr 2019 18:12:27 +0000 (14:12 -0400)]
Input aspect support in vkCreateRenderPass

Added support for:
VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO
VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO
in vkCreateRenderPass.

These only add extra validations, but don't modify the renderpass' behavior.

Bug b/119620965

Change-Id: I0102a4f7fdd9f57de4ef7b0a813ead951dafe0bb
Tests: dEQP-VK.renderpass.*_use_input_aspect
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28448
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Implement descriptor set arrays
Ben Clayton [Fri, 5 Apr 2019 11:12:30 +0000 (12:12 +0100)]
SpirvShader: Implement descriptor set arrays

Introduce a new Object::Kind - DescriptorSet.
This represents a pointer to a vk::DescriptorSet*, which is now
dereferenced to access the buffer data in OpAccessChain or OpLoad / OpStore.
This shuffling is required to handle descriptor array access
as the array index is only known at OpAccessChain time.

Tests: *dynamic*
Bug: b/126330097
Change-Id: Id754d966d8945f4e4fcf7895ed2210ce4f6ba713
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28391
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Rework pointer types
Ben Clayton [Fri, 5 Apr 2019 11:11:39 +0000 (12:11 +0100)]
SpirvShader: Rework pointer types

Previously Objects of the Variable kind would hold an Object::ID to another pointerBase object, which was combined with a per-lane offset in SpirvRoutine::intermediates.
This is almost exactly the same as PhysicalPointer - except the base address was taken from SpirvRoutine::physicalPointers.

With descriptor indices, we need a dynamic base pointer (only known at emit time) with per lane offsets.

This change transforms the Kind::Variable and Kind::PhysicalPointer kinds into Kind::DivergentPointer and Kind::NonDivergentPointer. This reduces complexity in loads and stores, and better represents the various forms of pointer we care about.

Bug: b/126330097
Change-Id: I514af5962b9cad4109197893066eda6f996be107
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28390
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoImprove the dEQP documentation for Linux.
Sean Risser [Wed, 3 Apr 2019 15:39:57 +0000 (11:39 -0400)]
Improve the dEQP documentation for Linux.

The original dEQP.md covered Windows pretty well, but was confusing to
follow on Linux. So I've fleshed out the Linux process to be as complete
as the Windows process.

Change-Id: I8373e56db7d8d74bf5bcdfc7c7d23b740a11c25a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28369
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Sean Risser <srisser@google.com>
5 years agoFix DescriptorUpdateTemplate::updateDescriptorSet
Ben Clayton [Thu, 4 Apr 2019 11:30:46 +0000 (12:30 +0100)]
Fix DescriptorUpdateTemplate::updateDescriptorSet

The logic did not handle desciptor arrays, or the descriptor overflow case.

Bug: b/123244275
Tests: *with_template*
Change-Id: Idf3f70848136865d1d76dc4f2f41b4c35d9230db
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28388
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Make value names more consistent
Ben Clayton [Thu, 4 Apr 2019 15:27:35 +0000 (16:27 +0100)]
SpirvShader: Make value names more consistent

Rename Object::Kind::Value to Object::Kind::Intermediate.
Rename SpirvRoutine::Value to SpirvRoutine::Variable.

Change-Id: I1dba30687cbf979d80b0deeca7a96e64a88c94db
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28393
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ 0e3d328a
SwiftShader Regression Bot [Fri, 5 Apr 2019 04:40:45 +0000 (05:40 +0100)]
Regres: Update test lists @ 0e3d328a

Change-Id: I45b04d1043a83a3732aab59a9009bdbbb1ee56ba
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28397
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSpirvRoutine: Verify create functions are called once per id
Ben Clayton [Thu, 4 Apr 2019 14:53:04 +0000 (15:53 +0100)]
SpirvRoutine: Verify create functions are called once per id

Just a safety belt that we're not doing stupid things.

Change-Id: I092b0755d151a559f793e1a9f30b17ef52626d10
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28389
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoImplement an Android NDK build of SwiftShader using the CMake files.
Stephen White [Thu, 4 Apr 2019 18:31:25 +0000 (14:31 -0400)]
Implement an Android NDK build of SwiftShader using the CMake files.

From the build directory, run:

  cmake -DCMAKE_TOOLCHAIN_FILE=../build/android.toolchain.cmake ..

Everything compiles and links. unittests, vk-unittests and ReactorUnitTests are known to work.
A "rundroid.sh" script is provided to upload and run Android binaries.
This CL has contains the first draft of an NDK-based FrameBuffer implementation.
It stubs out the gralloc calls in Image (consequence: EGLImage likely won't work).

NOTE: a small CMake patch is necessary; hopefully we'll find a way around this or land it in
CMake:

diff cmake-3.10/Modules/Platform/Android/Determine-Compiler-NDK.cmake.bak cmake-3.10/Modules/Platform/Android/Determine-Compiler-NDK.cmake
231c231
<   set(_ANDROID_TOOL_C_COMPILER_EXTERNAL_TOOLCHAIN ${CMAKE_ANDROID_NDK}/toolchains/${_ANDROID_TOOL_NAME}/prebuilt/${_ANDROID_HOST_DIR})
---
>   set(_ANDROID_TOOL_C_COMPILER_EXTERNAL_TOOLCHAIN ${CMAKE_ANDROID_NDK}/toolchains/${_ANDROID_TOOL_LLVM_NAME}/prebuilt/${_ANDROID_HOST_DIR})

Bug: b/129942368
Change-Id: I107a2f719256b6477ad105054ca68c676c05ec5c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27869
Presubmit-Ready: Stephen White <senorblanco@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoCreate a recursive version of MutexLock, and apply it to EGL.
Cody Schuffelen [Sat, 16 Mar 2019 00:31:10 +0000 (17:31 -0700)]
Create a recursive version of MutexLock, and apply it to EGL.

This fixes one deadlock in Android's use of SwiftShader. Now fixed for
ASAN/tsan.

Bug: b/124530765
Test: atest CtsGraphicsTestCases:android.graphics.cts.BitmapTest#testDrawingHardwareBitmapNotLeaking -- --abi x86
Test: b/124530765#comment53
Signed-off-by: Cody Schuffelen <schuffelen@google.com>
Change-Id: Iacb04c0ac515eca1849d365c20efa84d58b75f72
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28308
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRenderer.cpp: Refactor setBatchIndices...
Ben Clayton [Wed, 3 Apr 2019 18:36:29 +0000 (19:36 +0100)]
Renderer.cpp: Refactor setBatchIndices...

... so we can use it for the non-indexed case.

Bug: b/118386749
Tests: dEQP-VK.draw.basic_draw.*
Change-Id: I21f1616db0b6613f8db6bff61f6aa1dfcf67c253
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28356
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ 225a1301
SwiftShader Regression Bot [Thu, 4 Apr 2019 04:46:41 +0000 (05:46 +0100)]
Regres: Update test lists @ 225a1301

Change-Id: Ie0776ebefe7d83eee26b98b9dbc84efa30dd2cad
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28357
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoImplement dynamic buffer offsets.
Ben Clayton [Tue, 2 Apr 2019 11:28:22 +0000 (12:28 +0100)]
Implement dynamic buffer offsets.

Tests: *dynamic*
Bug: b/126330097
Change-Id: I7e4f7e3d921acb72878b7728216415ba66f63ec7
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28249
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRemoved SwiftShader's custom DrawType enum
Alexis Hetu [Thu, 22 Nov 2018 20:46:28 +0000 (15:46 -0500)]
Removed SwiftShader's custom DrawType enum

Replaced DrawType by VkPrimitiveTopology and VkIndexType.

Bug b/118386749

Change-Id: I6cd9a263b823e32c19ab85df7978cd674a757f1f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/22848
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd support for OpKill
Chris Forbes [Tue, 2 Apr 2019 00:37:37 +0000 (13:37 +1300)]
Add support for OpKill

Bug: b/124056625
Change-Id: I2e5650f81516da1e8f18775cb4b10ff5cfbb8a80
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28328
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoVkPipeline: Add basic optimization passes.
Ben Clayton [Wed, 3 Apr 2019 10:03:53 +0000 (11:03 +0100)]
VkPipeline: Add basic optimization passes.

A lot of the Regres timeouts we are seeing are in LLVM code generation.
These appear to happen for shaders with a pathological number of loads and stores - most likely created by glslang.
Each of these loads and stores produce a bunch of branches in the LLVM IR (due to lane masking), which then choke LLVM.

Tests: dEQP-VK.ssbo.layout.*
Change-Id: I0bb654d9001d0d6bdd02244844bed8e73ce8d9d4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28348
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Ignore unreachable inputs for Phis.
Ben Clayton [Wed, 3 Apr 2019 12:30:14 +0000 (13:30 +0100)]
SpirvShader: Ignore unreachable inputs for Phis.

Bug: b/128527271
Change-Id: I4bf01e7915735d7fd3dc827fd67873fff75a756f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28354
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Reduce dEQP logging efforts
Ben Clayton [Wed, 3 Apr 2019 11:39:15 +0000 (12:39 +0100)]
Regres: Reduce dEQP logging efforts

Nothing reads these, save the SSD R/W cycles!

Change-Id: Ic49a40387672a1e5aaedb169d9d46f61daedc430
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28353
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Remove hack to always start with a daily test
Ben Clayton [Wed, 3 Apr 2019 11:38:11 +0000 (12:38 +0100)]
Regres: Remove hack to always start with a daily test

Change-Id: Ia8793c5274985a8474407a42628b054136de8aa9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28352
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Include failure reasons in CI message
Ben Clayton [Wed, 3 Apr 2019 11:37:50 +0000 (12:37 +0100)]
Regres: Include failure reasons in CI message

Change-Id: I8aed6a72c4b9a2a575e441b846c581a67f82cf9b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28351
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Really kill timed-out processes
Ben Clayton [Wed, 3 Apr 2019 11:05:49 +0000 (12:05 +0100)]
Regres: Really kill timed-out processes

Only the parent process was being killed, allowing children to accumulate, eventually bringing down the machine.

Change-Id: I84e43265e53fe17058b3e3568919f6fad704f94f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28350
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Changes to reduce timeouts
Ben Clayton [Wed, 3 Apr 2019 11:03:28 +0000 (12:03 +0100)]
Regres: Changes to reduce timeouts

* Shuffle the test lists to mix heavy-load tests with lighter ones.
* Bump the test timeout to 10 minutes.

Change-Id: I886b08993a39ce78fd198ac4a1ce06f7378dbb20
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28349
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ 2b9fb4bf
SwiftShader Regression Bot [Wed, 3 Apr 2019 08:31:01 +0000 (09:31 +0100)]
Regres: Update test lists @ 2b9fb4bf

Change-Id: I91eb237cd3a501eb06054b3069661de5869d8678
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28255
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSwitch to LLVM 7.0 for Visual Studio solution
Nicolas Capens [Tue, 26 Mar 2019 19:43:08 +0000 (15:43 -0400)]
Switch to LLVM 7.0 for Visual Studio solution

Uses llvm.vcxproj generated by build/cmake.sh

Bug b/115344057

Change-Id: I09041d219f194e5ec97daad6b1b247a565909e98
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28110
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoDefault to 64-bit MSVC toolchain
Nicolas Capens [Thu, 28 Mar 2019 14:54:21 +0000 (10:54 -0400)]
Default to 64-bit MSVC toolchain

Prevents linking issues with LLVM 7.0.

Bug b/115344057

Change-Id: I7270c2bcf6095b1ec9911074b3119f87680a7cad
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28168
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoAdd missing LLVM 7.0 source files
Nicolas Capens [Tue, 26 Mar 2019 15:43:57 +0000 (11:43 -0400)]
Add missing LLVM 7.0 source files

Fixes linking for MSVC build.

Bug b/115344057

Change-Id: I9a38d987f0cf8c20c670ccdb1c38dd49681bb941
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27968
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoRename swiftshader_icd.def to libvk_swiftshader.def
Nicolas Capens [Tue, 26 Mar 2019 19:11:18 +0000 (15:11 -0400)]
Rename swiftshader_icd.def to libvk_swiftshader.def

The CMake build derives the .def name from the project name, which is
libvk_swiftshader.

Bug b/115344057
Bug b/116336664

Change-Id: I236839b2da4531e01f5260705c189d9ae8df9769
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27988
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years ago.gitignore: .vscode/settings.json & .vscode/launch.json
Ben Clayton [Wed, 27 Mar 2019 16:10:43 +0000 (16:10 +0000)]
.gitignore: .vscode/settings.json & .vscode/launch.json

This is per-user data and can easily contain paths to directories outside of the project.

Also remove .vscode/launch.json.

Change-Id: Iefedc52ec8446d4b6de5e6026761359ac9ac1a0f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28069
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoFix materialization of function arguments
Nicolas Capens [Tue, 2 Apr 2019 16:05:40 +0000 (12:05 -0400)]
Fix materialization of function arguments

Subzero does not appear to preserve function arguments passed in as
registers onto the stack by itself. Any scratch registers can get reused
for local variable register allocation.

This workaround simply materializes each concrete Reactor variable
constructed from an argument on definition. It does not ensure that
arguments turned into variables at a later point are properly preserved.
Also this solution does not centralize the materialization, making it
bug prone when new concrete Reactor types are implemented.

Bug b/129757459

Change-Id: I1007ea0e7204d05e60203b2e896589a03fc515a9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28309
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Update test lists @ 459453a9
SwiftShader Regression Bot [Tue, 2 Apr 2019 06:21:54 +0000 (07:21 +0100)]
Regres: Update test lists @ 459453a9

Change-Id: I3d7474e24faccf30a11a9c9bfdae69aa1ae918bf
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28251
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoEliminate Intermediate::replace()
Nicolas Capens [Wed, 27 Mar 2019 19:27:27 +0000 (15:27 -0400)]
Eliminate Intermediate::replace()

With Reactor variables now merely tracking the last assigned rvalue if
used within a single basic block, we can avoid the unsafe replace()
operation on SpirvShader::Intermediate.

This effectively reverts
https://swiftshader-review.googlesource.com/c/SwiftShader/+/27769

Bug b/129356087
Bug b/128527271

Change-Id: Ibfafc6960ac7e10b898ff8804752b928a7fc1988
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28109
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoElide single basic block variable materialization
Nicolas Capens [Wed, 27 Mar 2019 18:46:07 +0000 (14:46 -0400)]
Elide single basic block variable materialization

Variables which are only used within a single basic block and don't
have their address taken, don't require allocating stack memory.
Instead they can track the latest rvalue that has been assigned to them.
Allocating stack memory is necessary for variables that are assigned to
in divergent basic blocks since there is no single rvalue to track after
the merge point (unless we inserted phi instructions, but that is
outside of the scope of this change).

Because Reactor can't look forward to check whether a variable will be
used in divergent basic blocks, we keep the set of variables that may
not have been materialized yet, meaning they have no stack address yet.
When a branch is encountered, they are all materialized.

Variables not yet materialized at a Return() are 'killed' to prevent
materializing afterwards, which would cause the terminator ret
instruction to not be the last instruction of the basic block.

Note that this change creates a dependency of the Nucleus
implementation on Variable, which is currently defined in a higher
layer in Reactor.hpp. Since Variable doesn't depend on anything else
in Reactor.hpp it could be made part of Nucleus, or an in-between
layer could be added.

Bug b/129356087

Change-Id: Ie8c09e34c8befb9787a5c0bca7a20e770bcbf8d3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27928
Tested-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoAvoid Array<> assignment
Nicolas Capens [Wed, 27 Mar 2019 18:45:34 +0000 (14:45 -0400)]
Avoid Array<> assignment

The Array<> assignment operator gets auto-generated, but is unsafe as it
overwrites the Variable address field.

Also delete the Variable assignment operator.

Bug b/129356087

Change-Id: If6d5945f2a56f9a81bbc1491a524e3f17c1561da
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28088
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoImplement missing Short8 assignment operators
Nicolas Capens [Tue, 26 Mar 2019 21:18:57 +0000 (17:18 -0400)]
Implement missing Short8 assignment operators

Bug b/129356087

Change-Id: Iab3325d74e783fd158b49ca8f6512641bf7f89ec
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28008
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoCommon: Document sw::Resource
Ben Clayton [Fri, 22 Feb 2019 15:45:21 +0000 (15:45 +0000)]
Common: Document sw::Resource

It took me quite a while to figure out what this class was doing.

Change-Id: I97ab2576e309ee6ca69dd741fd47a86d8cdc6313
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25248
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRevert "Create a recursive version of MutexLock, and apply it to EGL."
Nicolas Capens [Sun, 31 Mar 2019 00:47:10 +0000 (00:47 +0000)]
Revert "Create a recursive version of MutexLock, and apply it to EGL."

This reverts commit 20b950a2520dfd30e84bd5e45153e6bce362752d.

Reason for revert: This is causing regressions in Chrome tests (https://chromium-review.googlesource.com/1546268) as well as google3 presubmit tests (cl/241036666). In both cases there's a timeout.

Bug: b/124530765
Change-Id: I570c4df5db9557a1ba7e46b07ba425f63cfa6744
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28268
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
5 years agoReactor: Replace ArgI for std::tuple_element
Ben Clayton [Wed, 27 Feb 2019 23:58:35 +0000 (23:58 +0000)]
Reactor: Replace ArgI for std::tuple_element

C++ now provides this template magic so you don't have to.

Also remove Arg(Function<Return(Arguments...)> &) function that wasn't referenced and wouldn't compile if it were.

Bug: b/126126820
Bug: b/129403963
Change-Id: I939e4f7cb95c32b8e663df7da6211460c5de605f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25749
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <headlessclayton@gmail.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Improve docs on IsStorageInterleavedByLane()
Ben Clayton [Fri, 8 Mar 2019 08:23:34 +0000 (08:23 +0000)]
SpirvShader: Improve docs on IsStorageInterleavedByLane()

My previous attempt to document this wasn't great.
Reworked the text and diagram to better illustrate what's going on.

Still using 'interleaved-by-lane' terminology for now.

Bug: b/126330097
Change-Id: Ia6031f06f9eab0f1f05d80151d9a89de5525b5eb
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26529
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <headlessclayton@gmail.com>
5 years agoRegres: Update test lists @ 513ed1d5
SwiftShader Regression Bot [Sat, 30 Mar 2019 06:43:05 +0000 (06:43 +0000)]
Regres: Update test lists @ 513ed1d5

Change-Id: I22da31a6704e8556c9b3ac03e4b71542b2993ecd
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28250
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSpirvShader: Fixes for complex loops.
Ben Clayton [Thu, 28 Mar 2019 16:07:00 +0000 (16:07 +0000)]
SpirvShader: Fixes for complex loops.

Emit loops in forward direction. While traversing backwards from the loop back-edge means you don't have to worry about flowing down the merge block, it can lead to blocks being generated in orders that can break the visit-once logic.

Don't consider flows passing through the return block as a back edge.

Strip unreachable blocks from ins - nothing should ever consider them.

Tests: dEQP-VK.glsl.loops.*
Bug: b/128527271
Change-Id: I497a06f5ce65d54b39294e4016b2df6d2c70487c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28188
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Handle dead code branches.
Ben Clayton [Tue, 26 Mar 2019 11:10:16 +0000 (11:10 +0000)]
SpirvShader: Handle dead code branches.

Given the following situation:

```

>->- alive >->->->
                  \
                    >-> alive
                  /
   unreachable >->

```

We would attempt to codegen the dead block (all blocks ensure their in's are processed first).

However dEQP-VK.spirv_assembly.instruction.graphics.conditional_branch.same_labels_false_frag seems to have dead blocks that use values from blocks it couldn't possibly use (as it has no ins).

While this is probably just a broken test, it is still good to harden up the compiler to pathological cases like this.

Tests: dEQP-VK.spirv_assembly.instruction.compute.*
Tests: dEQP-VK.spirv_assembly.instruction.graphics.*
Bug: b/128527271
Change-Id: Ibaacf6a58cf7ab6e73771b58cfe67f0c394e53c6
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27948
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoCreate a recursive version of MutexLock, and apply it to EGL.
Cody Schuffelen [Sat, 16 Mar 2019 00:31:10 +0000 (17:31 -0700)]
Create a recursive version of MutexLock, and apply it to EGL.

This fixes one deadlock in Android's use of SwiftShader.

Bug: b/124530765
Test: atest CtsGraphicsTestCases:android.graphics.cts.BitmapTest#testDrawingHardwareBitmapNotLeaking -- --abi x86
Signed-off-by: Cody Schuffelen <schuffelen@google.com>
Change-Id: I0a8a2674c94ae4fb8b3edb1a2b070b8b3568f8f2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27408
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoVkPipeline: Debug - show ids not names in disassembly.
Ben Clayton [Thu, 28 Mar 2019 17:15:04 +0000 (17:15 +0000)]
VkPipeline: Debug - show ids not names in disassembly.

Names are difficult to match against values in SpirvShader.

Change-Id: I313534c828b63bb73e8d72fa5475acfb93982bcd
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28190
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoFix descriptor set allocation and update
Nicolas Capens [Fri, 29 Mar 2019 10:22:17 +0000 (06:22 -0400)]
Fix descriptor set allocation and update

- Descriptor set pool allocation did not take the layout pointer into
  account.
- Allocating descriptor sets from the pool was not tracking the first
  node.
- The pointer to a second allocation node was offset from null instead
  of the pool base address.
- Added assert that the descriptor update type matches the layout.
- Refactoring to avoid duplicate casting of handles.

Bug b/123244275

Tests: dEQP-VK.api.object_management.*
Change-Id: Idf7aeb8d2597b30038ba1e9e371d99f09639f13c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28230
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ 51562f15
SwiftShader Regression Bot [Fri, 29 Mar 2019 06:39:44 +0000 (06:39 +0000)]
Regres: Update test lists @ 51562f15

Change-Id: Idc12be5aa3dc02ceec7eff3d148a730b9d5221f8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28248
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for OpMatrixTimesMatrix
Chris Forbes [Fri, 29 Mar 2019 02:08:39 +0000 (19:08 -0700)]
Add support for OpMatrixTimesMatrix

Bug: b/126873455
Test: dEQP-VK.glsl.matrix.*
Change-Id: I3070690017263b3bf766a329ef7729206f285e45
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28228
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoWire up indirect dispatch
Chris Forbes [Fri, 22 Mar 2019 21:47:47 +0000 (14:47 -0700)]
Wire up indirect dispatch

Bug: b/118619338
Change-Id: Ia03cbc8908efcbb5264f9fbdc91f06eac964c396
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27908
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd .vscode/c_cpp_properties.json
Ben Clayton [Wed, 27 Mar 2019 16:21:27 +0000 (16:21 +0000)]
Add .vscode/c_cpp_properties.json

This holds the project include paths and defines, used by the C++ intellisense engine.

Change-Id: Ib87220cd49a38901167283316d4b549717516a0b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28068
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoClaim support for multi draw indirect + base instance
Chris Forbes [Fri, 22 Mar 2019 21:34:44 +0000 (14:34 -0700)]
Claim support for multi draw indirect + base instance

Support for these features fell out of doing the indirect support
properly. They are optional in the Vulkan spec because of certain
hardware that can't source the base instance indirectly, or would
require the multi draw to be unrolled in the command buffer. We
have neither constraint.

Bug: b/118619338
Test: dEQP-VK.draw.*
Change-Id: I92291acc06a3abc5f25ea2a2eea18634b3035a01
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27889
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoImplement indirect draws
Chris Forbes [Fri, 22 Mar 2019 21:12:50 +0000 (14:12 -0700)]
Implement indirect draws

Bug: b/118619338
Test: dEQP-VK.draw.*
Change-Id: I282c0f1e8f44b0bec2318ab901ec511413bff11d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27888
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAllow subpasses to use secondary command buffers
Chris Forbes [Wed, 27 Mar 2019 20:28:27 +0000 (09:28 +1300)]
Allow subpasses to use secondary command buffers

Bug: b/118619338
Test: dEQP-VK.*secondary_cmd_buf*
Change-Id: I46e69e216ae4cc0a8e907692dfce270e11b690a2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28129
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd support for OpVectorTimesMatrix
Chris Forbes [Wed, 27 Mar 2019 21:32:55 +0000 (10:32 +1300)]
Add support for OpVectorTimesMatrix

Bug: b/126873455
Test: dEQP-VK.glsl.matrix.mul.*
Change-Id: Ifbc224ad72c27a0168578565a2b50eae8a1088f7
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28131
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoAdd support for OpMatrixTimesVector
Chris Forbes [Wed, 27 Mar 2019 20:53:20 +0000 (09:53 +1300)]
Add support for OpMatrixTimesVector

Bug: b/126873455
Test: dEQP-VK.glsl.matrix.mul.*
Change-Id: I818ea43d952f8d6d6a2a569a18936277a69b2fab
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28130
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoProper mipmap size allocation for compressed textures
Alexis Hetu [Wed, 27 Mar 2019 19:09:51 +0000 (15:09 -0400)]
Proper mipmap size allocation for compressed textures

Bug b/119620767

Change-Id: I2d0513ab4947e6794fb5122e625641ed1a7c84cb
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28108
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd support for compressed image copy
Alexis Hetu [Wed, 27 Mar 2019 15:33:15 +0000 (11:33 -0400)]
Add support for compressed image copy

Copying compressed images is just a matter of taking
block size into account and using a block as a single
unit of measure, instead of using a texel.

Bug b/119620767

Tests: dEQP-VK.api.copy_and_blit.core.image_to_image.all_formats.color.*

Change-Id: Ie77defc197ac7abb09a8555b384093fd50be681b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28048
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ 179c9324
SwiftShader Regression Bot [Thu, 28 Mar 2019 07:07:21 +0000 (07:07 +0000)]
Regres: Update test lists @ 179c9324

Change-Id: I633d574918a18cf5d9e1a5945067553bf59d443e
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28148
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for OpMatrixTimesScalar
Chris Forbes [Wed, 27 Mar 2019 20:16:20 +0000 (09:16 +1300)]
Add support for OpMatrixTimesScalar

For us this works identically to OpVectorTimesScalar.

Bug: b/126873455
Test: dEQP-VK.glsl.matrix.mul.*
Change-Id: Ied8df4af108249a2f0d888d238db497209d01049
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28128
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoHandle NULL 'value' to eglGetSyncAttribKHR()
Alistair Strachan [Wed, 27 Mar 2019 08:54:12 +0000 (17:54 +0900)]
Handle NULL 'value' to eglGetSyncAttribKHR()

The EGL spec does not specifically call out how to handle the case
where 'value' passed to eglGetSyncAttribKHR is NULL, however many
implementations will set the context error to EGL_BAD_PARAMETER
and return without crashing. dEQP has a test which specifically
checks for this behavior. Align SwiftShader's implementation with
other EGL implementations.

Bug: b/74572503
Test: dEQP-EQL GetSyncInvalidValueTest
Change-Id: Ic893cd7073c12c463ded78042031df1bf85f6ce2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28028
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alistair Strachan <astrachan@google.com>
5 years agoRemove asserts blocking pipeline derivatives
Chris Forbes [Fri, 22 Mar 2019 01:08:08 +0000 (18:08 -0700)]
Remove asserts blocking pipeline derivatives

* Implementations must ignore basePipelineIndex & basePipelineHandle
  if VK_PIPELINE_CREATE_DERIVATIVE_BIT is not specified.
* We choose to ignore the pipeline derivative controls entirely.
  This is consistent with other implementations.
* Also remove assert blocking pipeline construction for subpasses
  other than 0. This works fine.

Test: dEQP-VK.pipeline.derivative.compute.*
Change-Id: Ia03508b33397c60a3de5caf8536f7d75058738f6
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27828
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoAdd GLES unit tests to Kokoro Windows CI
Nicolas Capens [Tue, 19 Mar 2019 04:16:20 +0000 (00:16 -0400)]
Add GLES unit tests to Kokoro Windows CI

This required disabling the popup dialog which waits for a debugger to
be attached. This is achieved by setting an environment variable:
SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG=1

Bug b/123360006

Change-Id: Ic1269fdae3088b08a85322cbc7e33a3bdd8292cb
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27548
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoRegres: Update test lists @ e747b3c3
SwiftShader Regression Bot [Wed, 27 Mar 2019 06:37:48 +0000 (06:37 +0000)]
Regres: Update test lists @ e747b3c3

Change-Id: Ief5ca440d499e049a76564d09edcd924fa203aa9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27950
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSpirvShader: Implement loops
Ben Clayton [Thu, 21 Mar 2019 19:35:15 +0000 (19:35 +0000)]
SpirvShader: Implement loops

Tests: dEQP-VK.spirv_assembly.instruction.compute.*
Tests: dEQP-VK.spirv_assembly.instruction.graphics.*
Bug: b/128527271
Change-Id: Ib556737c88dad1e51f3482b218cd7b0a9787b5be
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27776
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRegenerate Windows LLVM configs
Nicolas Capens [Sat, 23 Mar 2019 01:25:35 +0000 (21:25 -0400)]
Regenerate Windows LLVM configs

Running 'python3 update.py windows' from 'third_party/llvm-7.0/scripts/'

Bug chromium:944811

Change-Id: I4cd1a51b2c50f775d3131d5c66b1d33350b8004b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27870
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRegenerate Linux LLVM configs
Nicolas Capens [Sat, 23 Mar 2019 02:01:22 +0000 (22:01 -0400)]
Regenerate Linux LLVM configs

Running 'python3 update.py linux' from 'third_party/llvm-7.0/scripts/'
Also includes common config changes for LLVM 7.0.1 release.

Bug chromium:944811

Change-Id: I22dadbe6024a0e46707361abc92630381de12ad6
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27871
Tested-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoAdd Windows support to LLVM config generation script
Nicolas Capens [Fri, 22 Mar 2019 19:13:07 +0000 (15:13 -0400)]
Add Windows support to LLVM config generation script

Windows doesn't support 'make', but CMake can build the generated files
using 'cmake --build'.

Also set host=x64 to ensure the 64-bit toolchain gets used, to avoid
LLVM linking issues.

Also define __i386__ and __x86_64__ macros.

Bug b/115344057

Change-Id: Idc3f78560b50e67b81a2e7a2490e0e5f23e6cc9d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27809
Tested-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoDisable LLVM_ENABLE_THREADS in config generation script
Nicolas Capens [Fri, 22 Mar 2019 19:15:33 +0000 (15:15 -0400)]
Disable LLVM_ENABLE_THREADS in config generation script

Bug chromium:944811

Change-Id: Ic44bfa123b5c64e3cd38022645a9e37ae5a29168
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27810
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Implement OpSwitch
Ben Clayton [Thu, 21 Mar 2019 18:57:23 +0000 (18:57 +0000)]
SpirvShader: Implement OpSwitch

Tests: dEQP-VK.spirv_assembly.instruction.compute.*
Tests: dEQP-VK.spirv_assembly.instruction.graphics.*
Bug: b/128527271
Change-Id: I7ba31ca504a582a4d36d25ef2747fb1c1607bade
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27775
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Implement OpBranchConditional, OpPhi, ...
Ben Clayton [Thu, 21 Mar 2019 18:47:15 +0000 (18:47 +0000)]
SpirvShader: Implement OpBranchConditional, OpPhi, ...

... OpUnreachable and OpReturn.

Tests: dEQP-VK.spirv_assembly.instruction.compute.*
Tests: dEQP-VK.spirv_assembly.instruction.graphics.*
Bug: b/128527271
Change-Id: Iec9af723c72c873df8cbdea7c0027e2f7fa25e70
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27774
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRenderpass multisampling resolve
Alexis Hetu [Wed, 20 Mar 2019 18:37:16 +0000 (14:37 -0400)]
Renderpass multisampling resolve

According to the Vulkan spec:
"If pResolveAttachments is not NULL, each of its elements
 corresponds to a color attachment (the element in
 pColorAttachments at the same index), and a multisample
 resolve operation is defined for each attachment. At the
 end of each subpass, multisample resolve operations read
 the subpass’s color attachments, and resolve the samples
 for each pixel to the same pixel location in the
 corresponding resolve attachments, unless the resolve
 attachment index is VK_ATTACHMENT_UNUSED."

Note: This cl adds support for multisampling, but
      requires syncing before performing the resolve
      operation. The intent is for the next cl to move
      the resolve to Renderer::finishRendering(), in
      order to avoid having to sync when it's not
      necessary.

Bug b/119620965

Change-Id: Id4fae41347e354b822d089fb5b6d4e36592c146b
Tests: dEQP-VK.pipeline.multisample.raster_samples.*
Tests: dEQP-VK.pipeline.multisample.raster_samples_consistency.*
Tests: dEQP-VK.pipeline.multisample.sample_mask.*
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27650
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoFill buffer fix
Alexis Hetu [Mon, 25 Mar 2019 14:24:23 +0000 (10:24 -0400)]
Fill buffer fix

memset was erroneously being used to copy 4 bytes at a time,
but the integer input value in memset is used as an 8 bit value,
so the fill was failing if the 4 bytes were not identical.

Tests: dEQP-VK.api.fill_and_update_buffer.*
Tests: dEQP-VK.memory.pipeline_barrier.host_read_transfer_dst.*

Bug b/118383648

Change-Id: I29cb5915ebd3773b4afbd89850c47a042fff6952
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27872
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Add EmitState
Ben Clayton [Thu, 21 Mar 2019 17:46:08 +0000 (17:46 +0000)]
SpirvShader: Add EmitState

As we implement more complex control flow, we need to emit blocks with different active lane masks, and have finer control over block generation.

Bug: b/128527271
Change-Id: Ica51bbea196b87ab442b394f0915e9a2cd375ac0
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27770
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Add Intermediate::replace()
Ben Clayton [Thu, 21 Mar 2019 17:54:06 +0000 (17:54 +0000)]
SpirvShader: Add Intermediate::replace()

This lets us use Intermediate for building intermediates in loops without the need of an alloca.

Bug: b/128527271
Change-Id: Id36db83d0b1cedd7700bbf2431eed9b4a03a7997
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27769
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Add flow control info to Block.
Ben Clayton [Thu, 21 Mar 2019 17:21:06 +0000 (17:21 +0000)]
SpirvShader: Add flow control info to Block.

Bug: b/128527271
Change-Id: Ib66c32ba66bcb322be6fa72f01f6c8b1b4b90f0a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27768
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRegres: Update test lists @ 221459f4
SwiftShader Regression Bot [Tue, 26 Mar 2019 05:49:01 +0000 (05:49 +0000)]
Regres: Update test lists @ 221459f4

Change-Id: If4da733b58f118698a84552ee3c9445203837767
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27786
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSupport for per-instance attributes
Chris Forbes [Sat, 9 Mar 2019 02:17:35 +0000 (18:17 -0800)]
Support for per-instance attributes

Bug: b/129149966
Test: dEQP-VK.*instance*
Change-Id: I51642d32a8390495f5d9ecd0bb64bca1db33a03d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26689
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoWork around another MSVC bug with variadic macros.
Ben Clayton [Mon, 25 Mar 2019 15:14:45 +0000 (15:14 +0000)]
Work around another MSVC bug with variadic macros.

Bug: b/129259232
Change-Id: I095618a97edd5d4e8e28b90dd8f329b140aaa248
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27785
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoFixed erroneous filtering
Alexis Hetu [Thu, 21 Mar 2019 22:04:29 +0000 (18:04 -0400)]
Fixed erroneous filtering

Even if all the coordinates are within the bounds, if filtering is
enabled and the coordinates are closer to the edge than the center
of the pixel, we have to enable clamping to the edge so that the
samples used for filtering don't get invalid/negative factors.

Bug b/119620767 b/129258757

Change-Id: I0ba50fff2c2873e4a852e34878883c2e707d9886
Tests: dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.scaling_whole2.*
Tests: dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.scaling_whole2.*
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27808
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ e276f52b
SwiftShader Regression Bot [Mon, 25 Mar 2019 05:49:53 +0000 (05:49 +0000)]
Regres: Update test lists @ e276f52b

Change-Id: Ie7796ec30e26be45a7b4c4233913c2ad94549b6d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27781
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoRemove extra stencil state from DrawData
Chris Forbes [Thu, 21 Mar 2019 21:14:40 +0000 (14:14 -0700)]
Remove extra stencil state from DrawData

In both the classic and pastel backends, we accidentally had *3* sets of
stencil state in the draw data. The generated routines use the array
only -- the separate stencilCCW variable is never touched.

Change-Id: I7898641bc8dbf387335528da3729e30d28b996aa
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27790
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRemove top-level kokoro/ folder
Nicolas Capens [Fri, 22 Mar 2019 18:55:46 +0000 (14:55 -0400)]
Remove top-level kokoro/ folder

We now use tests/kokoro/ instead.

Bug b/126742833

Change-Id: I50e41a6299238ca91ff92c0947b3060f9a840a5d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27789
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoBuild LLVM with threads disabled.
Nico Weber [Fri, 22 Mar 2019 13:15:16 +0000 (09:15 -0400)]
Build LLVM with threads disabled.

As far as I can tell, swiftshader doesn't use LLVM's threading capabilities
for anything, and disabling them sidesteps an issue with libc++/win -- so
turn them off.

Bug: chromium:944811
Change-Id: Idf7eee5aa4693e9d2dcb744638ad9de53f714173
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27849
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nico Weber <thakis@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoImplement atomic load/store memory ordering
Nicolas Capens [Thu, 21 Mar 2019 17:23:50 +0000 (13:23 -0400)]
Implement atomic load/store memory ordering

Bug b/127472316

Test: dEQP-VK.spirv_assembly.instruction.compute.opatomic.load
Test: dEQP-VK.spirv_assembly.instruction.compute.opatomic.store
Change-Id: I0379a1a74bc9742a3a9ae4d52b319e0838fd21bf
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27728
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoUse a C array for temporary load results
Nicolas Capens [Thu, 21 Mar 2019 21:04:05 +0000 (17:04 -0400)]
Use a C array for temporary load results

Array<> emits GEP instructions on every access, which aren't necessary.
Note that these temporaries are required because the If/Else blocks
both write to them, while the destination intermediate object is an
rvalue which can only be initialized once to maintain SSA form.

Also EmitAccessChain was moved to match the declaration order.

Bug b/128539387

Change-Id: I726fb0fd28b0a19a61e8759679e30bc699f3279d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27788
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoImplement atomic load/store
Nicolas Capens [Tue, 19 Mar 2019 20:22:35 +0000 (16:22 -0400)]
Implement atomic load/store

SIMD vector load and store are already atomic on x86 and ARM, and
Vulkan only supports atomic operations on "scalar 32-bit integer type".

Memory order semantics are handled in a follow-up change.

Bug b/127472316

Test: dEQP-VK.spirv_assembly.instruction.compute.opatomic.load
Test: dEQP-VK.spirv_assembly.instruction.compute.opatomic.store
Change-Id: I4481fe7b7aa792b63f516bd3cb1aab1d773bbcbd
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27649
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoRemoved redundant flag
Alexis Hetu [Fri, 22 Mar 2019 14:45:28 +0000 (10:45 -0400)]
Removed redundant flag

"-Wno-error=header-hygiene" was redundant with "-Wno-header-hygiene".
Removed it.

Change-Id: I5b75e8d42ef78c230cf064372f99db7950caf262
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27868
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Transition from out/ to build/
Ben Clayton [Mon, 18 Mar 2019 15:15:15 +0000 (15:15 +0000)]
Regres: Transition from out/ to build/

Change-Id: I9274f2141f14959ba614b57d45a637232baad5c8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27469
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Include an example test for each of top N failures
Ben Clayton [Fri, 22 Mar 2019 09:25:32 +0000 (09:25 +0000)]
Regres: Include an example test for each of top N failures

Bug: b/129056755
Change-Id: I01518b3cb802c45f2b3cc14e6e2c2f81416b4cd4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27782
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoMerge upstream LLVM r356524.
Nico Weber [Fri, 22 Mar 2019 12:16:16 +0000 (08:16 -0400)]
Merge upstream LLVM r356524.

Bug: chromium:944675
Change-Id: Icfe9d147fc6be936aac5a45f3bb6526022e5e898
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27848
Presubmit-Ready: Nico Weber <thakis@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nico Weber <thakis@chromium.org>
5 years agoPixelRoutine: Fix warning about missing override.
Ben Clayton [Thu, 21 Mar 2019 22:19:08 +0000 (22:19 +0000)]
PixelRoutine: Fix warning about missing override.

I have no idea why this has suddenly started firing.

Bug: b/123933266
Change-Id: If94903e2b549bd628eb912569c1bb803bd576951
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27777
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Minor changes for ASSERTs
Ben Clayton [Thu, 21 Mar 2019 17:32:44 +0000 (17:32 +0000)]
SpirvShader: Minor changes for ASSERTs

sw::Intermediate would only clear the contents to zero in debug builds, but would always validate that these were nullptr in release (ASSERT still warns in release).
Given the cost nullifying this memory is negligable in comparison to the actual LLVM JIT, always clear.

Changed a bunch of ASSERT()s to ASSERT_MSG() where the additional information is useful.

Replaced a few remaining calls to assert() with ASSERT()

Bug: b/127433389
Change-Id: Ifac89ca061bf7d61ff7d0de1792eeda18fad275c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27568
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <headlessclayton@gmail.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Update test lists @ b55772e6
SwiftShader Regression Bot [Fri, 22 Mar 2019 06:48:58 +0000 (06:48 +0000)]
Regres: Update test lists @ b55772e6

Change-Id: Ic3dcd942fe0f8d56536633434ce0b8ac6da8d066
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27778
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoVulkanUnitTests: Align the buffers to 0x100 for the compute tests
Ben Clayton [Thu, 21 Mar 2019 18:31:29 +0000 (18:31 +0000)]
VulkanUnitTests: Align the buffers to 0x100 for the compute tests

While not necessary for swiftshader, this is needed to compare against certain system vulkan drivers.

Bug: b/128527271
Change-Id: I64c9e39659d565a0369c2989a324e4c09dbf7c02
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27773
Presubmit-Ready: Ben Clayton <headlessclayton@gmail.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoVulkanUnitTests: Call vkDestroyDevice()
Ben Clayton [Thu, 21 Mar 2019 18:26:46 +0000 (18:26 +0000)]
VulkanUnitTests: Call vkDestroyDevice()

The system vulkan driver can get sulky if you don't free memory.

Bug: b/123749916
Change-Id: I9bf2de63a788200c401b41fa3efdfb36f3c15245
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27772
Presubmit-Ready: Ben Clayton <headlessclayton@gmail.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years ago.gitignore: .vscode/ipch directory
Ben Clayton [Thu, 21 Mar 2019 18:22:28 +0000 (18:22 +0000)]
.gitignore: .vscode/ipch directory

It seems an update has started make these C++ extension PCH files show up in version control.

Change-Id: I9af5dbf7e74bf8fb7d9ef25e84cce28b7424dda8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27771
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <headlessclayton@gmail.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoUse Kokoro configs/scripts for SwiftShader under tests/kokoro/ directory
Nicolas Capens [Thu, 21 Mar 2019 21:27:00 +0000 (17:27 -0400)]
Use Kokoro configs/scripts for SwiftShader under tests/kokoro/ directory

Bug b/126742833

Change-Id: Ic07ebc74f342566905690a6059c742c4c2c47acd
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27791
Tested-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoRemove remaining UBO & constants junk from DrawData
Chris Forbes [Fri, 8 Mar 2019 20:43:00 +0000 (12:43 -0800)]
Remove remaining UBO & constants junk from DrawData

This isn't used. We have Ben's shiny new descriptor-based UBO system now
instead.

Change-Id: If971e6bce3ddfb149d33dc5c42294d7b75c31888
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26609
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRename Intermediate::emplace() to move()
Nicolas Capens [Wed, 20 Mar 2019 01:38:44 +0000 (21:38 -0400)]
Rename Intermediate::emplace() to move()

Since we're essentially assigning from one rvalue to another, move()
seems to describe the intent better and even matches
register-to-register move instructions.

Bug b/128539387

Change-Id: I409b3ede9578a100f25ea92e61f7492a38341ca4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26869
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>