OSDN Git Service

android-x86/external-swiftshader.git
5 years agoReactor: Add a PrintValue for Bool types.
Ben Clayton [Tue, 12 Mar 2019 20:05:43 +0000 (20:05 +0000)]
Reactor: Add a PrintValue for Bool types.

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

5 years agoSpirvShader: Fix int DBZ failures by masking away zeros.
Ben Clayton [Thu, 14 Mar 2019 12:21:53 +0000 (12:21 +0000)]
SpirvShader: Fix int DBZ failures by masking away zeros.

The Vulkan spec says:
"division by zero produces an unspecified result but must not lead to Vulkan interruption or termination".

Tests: dEQP-VK.glsl.operator.binary_operator.mod.*
Tests: dEQP-VK.glsl.operator.binary_operator.div.*
Bug: b/127962486
Change-Id: I62e7c29a6e944512db7a8a96b0bb87488aa7be73
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27171
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoSpirvShader: Replace Intermediate::operator[] with typed getters.
Ben Clayton [Fri, 8 Mar 2019 09:32:34 +0000 (09:32 +0000)]
SpirvShader: Replace Intermediate::operator[] with typed getters.

Simplifies things throughout the cpp.

Bug: b/128539387
Change-Id: I7abbe4731d82877204976d654859cba88d1a3047
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26531
Tested-by: Ben Clayton <headlessclayton@gmail.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoSpirvShader: Overload Intermediate::emplace for Int and UInt.
Ben Clayton [Fri, 8 Mar 2019 08:37:24 +0000 (08:37 +0000)]
SpirvShader: Overload Intermediate::emplace for Int and UInt.

Removes a load of noise throughout the cpp file.

Bug: b/128539387
Change-Id: Ic9fa9361c4b7dc6258833e2ce58db50b5e81b11d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26530
Tested-by: Ben Clayton <headlessclayton@gmail.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoRegres: Update test lists @ 868ed908
SwiftShader Regression Bot [Thu, 14 Mar 2019 05:45:01 +0000 (05:45 +0000)]
Regres: Update test lists @ 868ed908

Change-Id: Ic0153dc04839fe44093091564dc181d394b32d12
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27099
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for remaining GLSL builtin geometric functions
Chris Forbes [Thu, 14 Mar 2019 00:39:45 +0000 (17:39 -0700)]
Add support for remaining GLSL builtin geometric functions

Bug: b/127804400
Test: dEQP-VK.glsl.operator.geometric.*
Change-Id: I63d852c2978be4c1966886cf24c489cc7c286964
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27128
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 agoRefactor common Reactor implementations
Nicolas Capens [Wed, 13 Mar 2019 03:00:24 +0000 (23:00 -0400)]
Refactor common Reactor implementations

Some functions in LLVMReactor.cpp and SubzeroReactor.cpp were identical
and have been moved into a common Reactor.cpp.

Bug swiftshader:21

Change-Id: Ib079757f9e35f83b1103e2791227f02775e034d3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27068
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoChange scissor type from sw::Rect to VkRect2D
Alexis Hetu [Wed, 13 Mar 2019 14:33:10 +0000 (10:33 -0400)]
Change scissor type from sw::Rect to VkRect2D

Removed sw::Rect from Renderer.

Bug b/126883332

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

5 years agoRemove old Framebuffer code from Vulkan
Alexis Hetu [Wed, 13 Mar 2019 12:05:02 +0000 (08:05 -0400)]
Remove old Framebuffer code from Vulkan

Framebuffer related code is being implemented properly
in VkSurfaceKHR.cpp and related files, so old OpenGL
framebuffer code can be removed to avoid confusion.

Bug b/124265819

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

5 years agoRemove precacheDLL
Alexis Hetu [Tue, 12 Mar 2019 20:32:04 +0000 (16:32 -0400)]
Remove precacheDLL

Remove leftover variables not cleaned up in:
https://swiftshader-review.googlesource.com/c/SwiftShader/+/7250

Change-Id: Ia2e66c15e5cadeed32f564c60d5105c17319e9d4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27028
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years ago[cmake] Check for deps before adding.
Dan Sinclair [Mon, 11 Mar 2019 14:48:19 +0000 (10:48 -0400)]
[cmake] Check for deps before adding.

When embedding SwitftShader into a third party application, the top
level cmake files may already include googletest and SPIRV-Tools. This
CL updates the SwiftShader tests to only try to pull in googletest if
the `gtest` target is not found and only pull in SPIRV-Tools if the
`SPIRV-Tools` target is not found.

Change-Id: I3c3ebb528725017dbbb80aa05b01ee2de8d4a2d1
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26788
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Dan Sinclair <dsinclair@google.com>
5 years agoRemoved references to sw::Surface
Alexis Hetu [Tue, 12 Mar 2019 18:19:22 +0000 (14:19 -0400)]
Removed references to sw::Surface

Removed sw::Surface dependency from:
- Blitter
- Context
- PixelProcessor
- PixelRoutine
- Renderer
- VkFramebuffer

No behavior changes should be happen with this cl.

Bug b/126883332

Change-Id: I4146f043ba8e5008eb3d44465c26a0f34a2e1acc
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26969
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>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agosrc/Pipeline/ComputeProgram: Remove unused parameter numDescriptorSets
Ben Clayton [Tue, 12 Mar 2019 15:58:02 +0000 (15:58 +0000)]
src/Pipeline/ComputeProgram: Remove unused parameter numDescriptorSets

Change-Id: I1881916302d6652144138106d0744e9bbd2b45c8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27008
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Alexis Hétu <sugoi@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: Update test lists @ bea47513
SwiftShader Regression Bot [Wed, 13 Mar 2019 07:03:50 +0000 (07:03 +0000)]
Regres: Update test lists @ bea47513

Change-Id: I5d87130b1c52cd7c3e2a21d1a1f0fcbe6d2b40ed
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27049
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for D16_UNORM depth test & write
Chris Forbes [Tue, 12 Mar 2019 21:50:55 +0000 (14:50 -0700)]
Add support for D16_UNORM depth test & write

D16_UNORM depth operations are performed in fixed point to avoid quirks
of ushort <-> float roundtrip

Some slight oddities to work around missing primitives:
- We only have CmpEQ, CmpGT. This matches SSE hardware reality.
  Everything else is made out of negations and operand swaps.
- We only have *signed* CmpGT. Make an unsigned CmpGT by biasing both
  16-bit operands by -0x8000.
- In non-quad-layout we don't have a good way to separate .xy and .zw
  halfs; reading via masked short4 reads, writing via individual
  component writes.

Bug: b/128363727
Test: dEQP-VK.pipeline.depth.format.*
Change-Id: I9c8b249470a9c91589c91135988dc4d1a58bbc5f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27030
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 very early depth test
Chris Forbes [Tue, 12 Mar 2019 20:42:28 +0000 (13:42 -0700)]
Remove very early depth test

Bug: b/128363727
Change-Id: Ia595876610b077c4be366174264de7a55f14dc4c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27029
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 agoSubzero MulHigh implementation for Int4/UInt4
Chris Forbes [Fri, 1 Mar 2019 22:18:30 +0000 (14:18 -0800)]
Subzero MulHigh implementation for Int4/UInt4

Also add implementations of multiplication and right shift for Long type.

Bug b/126873455

Change-Id: I9952c2b9a3feca6a7741cd02e2295340935e4447
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25988
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoWait semaphores for VkQueuePresentKHR
Hernan Liatis [Tue, 12 Mar 2019 18:34:24 +0000 (11:34 -0700)]
Wait semaphores for VkQueuePresentKHR

Bug: b/124265819
Change-Id: I7c84c3be8fb13a4ef798f90b8c610ebeafa82b5c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26970
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
5 years agoHandle oldSwapchains
Hernan Liatis [Sat, 9 Mar 2019 01:57:41 +0000 (17:57 -0800)]
Handle oldSwapchains

When we create a new swapchain, we can pass in a
parent swapchain from the same surface. The old
swapchain is no longer associated with the surface
and "retires" by deleting all non-acquired images.

Bug: b/124265819
Change-Id: I31315045c926b929483d1b6cb1fc3d9f7aa87b94
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26668
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
5 years agoRemove complementary depth buffer option for Vulkan
Chris Forbes [Tue, 12 Mar 2019 20:01:45 +0000 (13:01 -0700)]
Remove complementary depth buffer option for Vulkan

Bug: b/128363727
Change-Id: Id75e138deda980f57b7bd07192b1353b2b414fd8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26988
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoFix resizing issues
Hernan Liatis [Wed, 6 Mar 2019 23:31:04 +0000 (15:31 -0800)]
Fix resizing issues

In summary, this change associates a 1:1
correspondance between a VkImage and XImage.
This will fix resize issues as well as prepare
to implement createInfo->oldSwapchain.

Bug: b/124265819
Change-Id: I42e8e1e7b5c9a5b64820156603dca10e2ab828ca
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26368
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
5 years agoWarning fix
Alexis Hetu [Tue, 12 Mar 2019 15:50:20 +0000 (11:50 -0400)]
Warning fix

Removed unused variable

Change-Id: I9236d02e04fb58a081c608d16f4e1eadf81dde16
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26949
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoFix Visual Studio build of VulkanUnitTests
Nicolas Capens [Tue, 12 Mar 2019 15:23:28 +0000 (11:23 -0400)]
Fix Visual Studio build of VulkanUnitTests

- Make VulkanUnitTests depend on SPIRV-Tools.
- Build Vulkan DLLs but don't link statically with VulkanUnitTests.
- Don't use Unicode character set.
- Statically link runtime library.
- Fix narrowing conversion from 'VkCommandBufferUsageFlagBits' to
  'VkCommandBufferUsageFlags'.

Bug swiftshader:125

Change-Id: I7dbdc25c829cc76b5e05cd57cd9f85bf2d4e0903
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26948
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
5 years agovkAcquireNextImageKHR and vkQueuePresentKHR
Hernan Liatis [Fri, 1 Mar 2019 23:06:13 +0000 (15:06 -0800)]
vkAcquireNextImageKHR and vkQueuePresentKHR

The following changes will allow to present
to the screen. However, do not adjust the
size of the window.

Bug: b/124265819
Change-Id: Iaa42f458af9555e91d47238397112324ec080a67
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26008
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
5 years agoPlumb depth format through to PixelProcessor::State
Chris Forbes [Tue, 12 Mar 2019 01:28:55 +0000 (18:28 -0700)]
Plumb depth format through to PixelProcessor::State

I need this in order to support depth formats that arent D32F.

Bug: b/128363727
Change-Id: I7016351207e433e668053ebaf4dbeb9f2f7936f2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26888
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>

5 years agoFix image format properties query in various edge cases
Chris Forbes [Mon, 11 Mar 2019 21:34:12 +0000 (14:34 -0700)]
Fix image format properties query in various edge cases

- Many cases where sampleCounts is required to be VK_SAMPLE_COUNT_1_BIT by spec
- Missing feature flags for ETC2 formats
- Max array layers must be 1 for 3D

See 38.1.1 Supported Sample Counts for details of sample count
requirements

Bug: b/128344974
Test: dEQP-VK.api.info.image_format_properties*
Change-Id: I3ffe747a8cc8d06e0d33aa0937bd2b7ecd045ff5
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26871
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 agoAdd utility functions from sw::Surface to vk::Format
Alexis Hetu [Mon, 11 Mar 2019 21:34:13 +0000 (17:34 -0400)]
Add utility functions from sw::Surface to vk::Format

In order to eventually remove sw::Surface, some utility
functions used by vk::Image were copied to vk::Format.

Bug b/126883332

Change-Id: Ie8404b70adc3336d536dcd5c0ec26b63e46c5174
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26872
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agotests/regres/export_to_sheets: Fix off-by-one in loop
Ben Clayton [Tue, 12 Mar 2019 08:55:15 +0000 (08:55 +0000)]
tests/regres/export_to_sheets: Fix off-by-one in loop

We weren't looking at the most recent change.
Kinda important when that's typically the new test list you're trying to export.

Change-Id: I0e312dbde0ae54feb0641a658eebc73bbdb47eaa
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26928
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agotests: Add a unit test for a simple memcpy compute shader
Ben Clayton [Fri, 1 Mar 2019 14:33:35 +0000 (14:33 +0000)]
tests: Add a unit test for a simple memcpy compute shader

Bug: b/126871859
Change-Id: I0b3db6c033419a2ad54453d470960330d4f337cc
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25909
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 agoVulkan: Very rough first implementation of compute shaders
Ben Clayton [Fri, 8 Mar 2019 12:02:05 +0000 (12:02 +0000)]
Vulkan: Very rough first implementation of compute shaders

This is by no means finished:
* ComputeProgram holds the codegen and the invoke logic. ComputeProgram::run() should probably be moved somewhere else (maybe Renderer?).
* ComputeProgram::run() is currently fully single threaded.
* The compute routines are currently not cached.

With that said, this is enough to start passing a whole bunch of dEQP compute tests.

Test: *.compute.*
Bug: b/126871859
Change-Id: Ic6a76826b2fec0d34d54e0bed564b360ea0610c0
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26551
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 agoAdd vulkan unit tests to Kokoro
Ben Clayton [Mon, 11 Mar 2019 15:11:24 +0000 (15:11 +0000)]
Add vulkan unit tests to Kokoro

Change-Id: I6e695dd5221da6d9f7f198bc2af8aee00eda8881
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26808
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 @ 3364227f
SwiftShader Regression Bot [Tue, 12 Mar 2019 06:38:51 +0000 (06:38 +0000)]
Regres: Update test lists @ 3364227f

Change-Id: I15fb0452789a7a3e3f84453a1b2d9a1b969d510f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26908
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAllow the Blitter to clear and blit vk::Image objects directly
Alexis Hetu [Fri, 1 Mar 2019 16:55:59 +0000 (11:55 -0500)]
Allow the Blitter to clear and blit vk::Image objects directly

The sw::Surface object was the intermediate representation of an
image used between the vk::Image and the Blitter. This cl removes
the need for an intermediate representation by having the Blitter
use the vk::Image directly.

There should be no regression for the clear and blit tests.

Bug b/126883332

Change-Id: Icbc15470e3ad112ed78f4f62d6d82c66e3e37a20
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25928
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: Chris Forbes <chrisforbes@google.com>
5 years agotests: Add a Driver class to abstract the vulkan implementation
Ben Clayton [Fri, 1 Feb 2019 13:08:23 +0000 (13:08 +0000)]
tests: Add a Driver class to abstract the vulkan implementation

The idea here is that we can build a number of fine granularity SPIR-V tests, which we can also verify against any optional system Vulkan hardware.

This CL adds support for building and running the Vulkan unit tests on mac and linux.

Bug: b/123749916
Change-Id: I01a4e2a914ffd5473d271013957fa3dddbc43645
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/24328
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoAdd reactor unit tests to Kokoro
Nicolas Capens [Mon, 11 Mar 2019 14:39:51 +0000 (10:39 -0400)]
Add reactor unit tests to Kokoro

Bug b/123360006

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

5 years agoRefactor emulated vector type handling for LLVM
Nicolas Capens [Fri, 8 Mar 2019 22:26:43 +0000 (17:26 -0500)]
Refactor emulated vector type handling for LLVM

- Add clarifying comments.
- Add self-explanatory helper functions.
- Fix typeSize to handle all Reactor types.
- Use uintptr_t base type for emulated type enum.
  Prevents 0x########00000000 from being interpreted as emulated type.

Bug b/126028338

Change-Id: Ib38cf9b59f58c0f6046f9c84a6152849791bb4ed
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26648
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoSpirvShader: Implement SMod.
Ben Clayton [Fri, 8 Mar 2019 12:04:00 +0000 (12:04 +0000)]
SpirvShader: Implement SMod.

Test: *smod*
Bug: b/126873455
Change-Id: If946e72d23aa9386b85cffe96b02ab63195f0a24
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26549
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd test/regres/export_to_sheets.go
Ben Clayton [Mon, 11 Mar 2019 11:44:43 +0000 (11:44 +0000)]
Add test/regres/export_to_sheets.go

Exports the latest test data to a Google Sheets document.

Change-Id: Ia1b38464daf7117da571d536e7ff029023b9de58
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26748
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoRename Win32 configuration to x86
Nicolas Capens [Fri, 8 Mar 2019 22:45:37 +0000 (17:45 -0500)]
Rename Win32 configuration to x86

This causes Visual Studio to default to the x64 configuration, which is
64-bit instead of 32-bit.

Change-Id: Ifb1246216c726e6ad0dcc7891f2f3a8f89aeff7c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26649
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Handle OpTypeRuntimeArray in WalkAccessChain.
Ben Clayton [Fri, 8 Mar 2019 16:51:42 +0000 (16:51 +0000)]
SpirvShader: Handle OpTypeRuntimeArray in WalkAccessChain.

Fixes tests that turned from PASS -> CRASH by adding compute shader support.

Bug: b/120799499
Change-Id: I72190eef98223851cba3d61a98d54ab2f6e2a0a7
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26553
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoRegres: Update test lists @ ebefaf7c
SwiftShader Regression Bot [Mon, 11 Mar 2019 07:30:57 +0000 (07:30 +0000)]
Regres: Update test lists @ ebefaf7c

Change-Id: If451dc09203631737739b30d385fbf8a215b2b46
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26728
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Drop support for tests results only on new change
Ben Clayton [Fri, 8 Mar 2019 19:29:49 +0000 (19:29 +0000)]
Regres: Drop support for tests results only on new change

The test list from the latest patchset is now run on the parent.
Missing tests are a bug.

Change-Id: I149e235968acad4988d0fcff78d8a8796aaf118c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26559
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Scan commit message for additional test lists.
Ben Clayton [Fri, 8 Mar 2019 19:26:24 +0000 (19:26 +0000)]
Regres: Scan commit message for additional test lists.

Change-Id: Ib0beec96a6efafa0ee6fb8a43e15142206d3cd4d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26558
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Run latest PS testlists on parent.
Ben Clayton [Fri, 8 Mar 2019 17:10:48 +0000 (17:10 +0000)]
Regres: Run latest PS testlists on parent.

This is better than running potentially two different test lists for both.

Requires caching the parent test results with the testlist's hash as a cache key.

Change-Id: Ic153e65395fc1c3f02a66bbb1df60731ce28901b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26557
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSpirvShader: Fix unused local warning in release builds.
Ben Clayton [Fri, 8 Mar 2019 09:45:25 +0000 (09:45 +0000)]
SpirvShader: Fix unused local warning in release builds.

Bug: b/123933266
Change-Id: I4585c881ea7328b03b7c98bd5b4c255a399a0a70
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26532
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Update test lists @ 856ebf87
SwiftShader Regression Bot [Sat, 9 Mar 2019 06:36:21 +0000 (06:36 +0000)]
Regres: Update test lists @ 856ebf87

Change-Id: I6cd54eefee8e4fe0a20799bf6bce85ddd53df9d5
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26708
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for OpVectorTimesScalar
Chris Forbes [Fri, 8 Mar 2019 23:30:18 +0000 (15:30 -0800)]
Add support for OpVectorTimesScalar

This gets us the final few cases in the glsl multiplies group.

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

5 years agoAdd support for more ExtInst instructions
Chris Forbes [Fri, 8 Mar 2019 22:50:44 +0000 (14:50 -0800)]
Add support for more ExtInst instructions

- FMin
- FMax
- SMin
- SMax
- UMin
- UMax
- Step
- SmoothStep
- FMix
- FClamp
- SClamp
- UClamp
- FSign
- SSign

Test: dEQP-VK.glsl.operator.common_functions.*
Bug: b/127804400
Change-Id: Ie136d8f0386f6a1db9acbf4e261851ce696e2d95
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26650
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 agoAdd support for Trunc,Ceil,Fract,Round,RoundEven
Chris Forbes [Fri, 8 Mar 2019 21:36:40 +0000 (13:36 -0800)]
Add support for Trunc,Ceil,Fract,Round,RoundEven

Mostly trivial; exception is RoundEven, for which I borrowed the
implementation from the GLES side.

Test: dEQP-VK.glsl.operator.common_functions.*
Bug: b/127804400
Change-Id: I889c3750ebdbc078723890488cf44d89ea77103b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26628
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 agoAdd support for OpLogicalEqual, OpLogicalNotEqual
Chris Forbes [Fri, 8 Mar 2019 20:16:57 +0000 (12:16 -0800)]
Add support for OpLogicalEqual, OpLogicalNotEqual

Test: dEQP-VK.glsl.operator.bool_compare.*
Test: dEQP-VK.glsl.operator.binary_operator.equal.*
Test: dEQP-VK.glsl.operator.binary_operator.not_equal.*
Bug: b/126870789
Change-Id: I9d33444d67792274d8027b7d1632235533cfc079
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26574
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 GLSLstd450Floor ExtInst
Chris Forbes [Fri, 8 Mar 2019 20:02:27 +0000 (12:02 -0800)]
Add support for GLSLstd450Floor ExtInst

Bug: b/127804400
Test: dEQP-VK.glsl.operator.common_functions.floor.*
Change-Id: Iaefeef8f006673e55d4f85184d7782ac0aafb314
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26572
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>
Tested-by: Chris Forbes <chrisforbes@google.com>
5 years agoBuild fix
Alexis Hetu [Fri, 8 Mar 2019 20:15:20 +0000 (15:15 -0500)]
Build fix

Bug swiftshader:125

Change-Id: If24564a16d880a11e782e5f6b4f035e612255076
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26573
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoMove Blitter ownership from Image to Device
Alexis Hetu [Wed, 27 Feb 2019 17:54:52 +0000 (12:54 -0500)]
Move Blitter ownership from Image to Device

The blitter has a cache which can allow us to reuse already used
routines, so it should be kept in a central location. For that
reason, the blitter ownership was moved from the Image object to
the Device object.

Bug b/117974925

Change-Id: I825853c381dcbc04701b1d9e7dfa376108294221
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25728
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd support for GLSLstd450Cross ExtInst
Chris Forbes [Fri, 8 Mar 2019 19:31:31 +0000 (11:31 -0800)]
Add support for GLSLstd450Cross ExtInst

Fixes dEQP-VK.glsl.operator.geometric.cross.*

Bug: b/127804400
Change-Id: I62337ba547048426c76adb1e90a1ebc4079e2a3d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26571
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 agoDescriptor Update Template implementation
Alexis Hetu [Tue, 29 Jan 2019 19:09:36 +0000 (14:09 -0500)]
Descriptor Update Template implementation

Basic implementation of descriptor update template.
Only supports VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET template type.

Bug b/123244275

Change-Id: Iaf7c1e52bee6d2683a2f34bd2f780396aa953442
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26568
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoFix OpVectorShuffle with mixed vector widths
Chris Forbes [Fri, 8 Mar 2019 18:41:05 +0000 (10:41 -0800)]
Fix OpVectorShuffle with mixed vector widths

There is a subtle trap here -- almost all SPIRV instructions require vector
widths to match, but for OpVectorShuffle, the widths of the result
vector and the two sources are completely independent.

Fixes dEQP-VK.glsl.operator.unary_operator.plus.highp_vec2_vertex and many others.

Bug: b/127959969
Change-Id: Iaa2cc09fb510fa2ab07a6f53599af8dade553a9a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26570
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Fix bad binning of QualityWarnings
Ben Clayton [Fri, 8 Mar 2019 17:11:12 +0000 (17:11 +0000)]
Regres: Fix bad binning of QualityWarnings

Change-Id: I0fba3c2969cd61c8e7b6e30628473944f2e5a986
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26555
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd support for OpFMul
Chris Forbes [Fri, 8 Mar 2019 17:53:03 +0000 (09:53 -0800)]
Add support for OpFMul

Fixes many tests in dEQP-VK.glsl.*

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

5 years agoAdd support for OpAny, OpAll
Chris Forbes [Fri, 8 Mar 2019 17:09:18 +0000 (09:09 -0800)]
Add support for OpAny, OpAll

A step toward being able to run many of dEQP-VK.glsl.*

Bug: b/126870789
Change-Id: Id53d5a511d7f0fa10994c46254529027ad773542
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26569
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 agoCollect Offset,MatrixStride,ArrayStride decorations
Chris Forbes [Fri, 8 Mar 2019 00:13:56 +0000 (16:13 -0800)]
Collect Offset,MatrixStride,ArrayStride decorations

These decorations are used for all explicit layout storage classes --
Uniform, StorageBuffer, PushConstant.

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

5 years agoSkip remaining debug instructions
Chris Forbes [Fri, 8 Mar 2019 15:51:39 +0000 (07:51 -0800)]
Skip remaining debug instructions

Change-Id: Ie4e2c11c495f17bf628b3c828ce81596e3d73e5f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26588
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoFix inconsistencies in advertised dimensions vs levels
Chris Forbes [Fri, 8 Mar 2019 01:20:32 +0000 (17:20 -0800)]
Fix inconsistencies in advertised dimensions vs levels

Level count was off by one for the size.
Also change vk::MAX_IMAGE_ARRAY_LAYERS to be the actual value rather
than log2 -- this was a bug waiting to happen somewhere.

Bug: b/118429780
Change-Id: I783a11571f90c34302a4ead8476009d309880eb6
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26508
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRemove literal string from error message.
Nicolas Capens [Thu, 7 Mar 2019 20:07:08 +0000 (15:07 -0500)]
Remove literal string from error message.

The lexer doesn't actually keep the string for literals.

Bug chromium:939239

Change-Id: Ib8b28e75e36d1c6beff8afa580fc4c29c23b6eb0
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26428
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoRegres: Update test lists @ 3ed33cee
SwiftShader Regression Bot [Fri, 8 Mar 2019 06:30:04 +0000 (06:30 +0000)]
Regres: Update test lists @ 3ed33cee

Change-Id: I32f5d800fdbc0c2e672c3b92b64745fe34d23573
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26528
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for OpIsInf, OpIsNan
Chris Forbes [Thu, 7 Mar 2019 21:38:31 +0000 (13:38 -0800)]
Add support for OpIsInf, OpIsNan

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

5 years agoReactor (LLVM): Fix GEP for Pointer<Pointer<T>> types
Ben Clayton [Wed, 27 Feb 2019 23:56:18 +0000 (23:56 +0000)]
Reactor (LLVM): Fix GEP for Pointer<Pointer<T>> types

Also add a bunch of tests.

Bug: b/126028338
Change-Id: Ic8eb822dce3eff402e2a5f222c5077c6831f4505
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25748
Tested-by: Ben Clayton <bclayton@google.com>
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoStart support for OpExtInst
Chris Forbes [Thu, 7 Mar 2019 17:26:48 +0000 (09:26 -0800)]
Start support for OpExtInst

- OpExtInstImport now enforces correct instruction set
- OpExtInst dispatch done
- Implemented FAbs, SAbs

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

5 years agoSpirvShader: Implement Uniform and StorageBuffer access
Ben Clayton [Tue, 5 Mar 2019 17:38:16 +0000 (17:38 +0000)]
SpirvShader: Implement Uniform and StorageBuffer access

Bug: b/126330097
Change-Id: Ia612ddf785b79b88a59c30b1e436470bb3fba3e8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26228
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSpirvShader: Add PhysicalPointers
Ben Clayton [Wed, 27 Feb 2019 14:57:18 +0000 (14:57 +0000)]
SpirvShader: Add PhysicalPointers

And add load / store paths to deal with data layouts that are not interleaved by lane.

Bug: b/126330097

Change-Id: Id7730a606d623ffe74ae57668216f05159972f10
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25710
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd regres tool.
Ben Clayton [Sat, 16 Feb 2019 01:05:23 +0000 (01:05 +0000)]
Add regres tool.

Regress is a tool that detects test regressions with SwiftShader changes.

Regres monitors changes that have been put up for review with Gerrit.
Once a new patchset has been found, regres will checkout, build and test the change against the parent changelist. Any differences in results are reported as a review comment on the change.

Change-Id: I0a848a56d99f020d6ffd48699a2277fa71526788
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/24929
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRequire 16-byte alignment for Vulkan objects
Chris Forbes [Thu, 7 Mar 2019 20:07:13 +0000 (12:07 -0800)]
Require 16-byte alignment for Vulkan objects

At least for large formats, we assume 16 byte alignment for render
target writes. Requiring 16 bytes in general seems a good idea for
x86_64.

Bug: b/127721996
Change-Id: Ie4d2d9bf71fb8a3d8b58f099785e75a72ff0e181
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26448
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>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoRegres: Update test lists @ 2995dc2a
SwiftShader Regression Bot [Thu, 7 Mar 2019 06:33:34 +0000 (06:33 +0000)]
Regres: Update test lists @ 2995dc2a

Change-Id: I5c4e28ccd80163c03a7172b8db881ea28e9e0203
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26350
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoReactor: Fix createFCmpUNE (LLVM)
Ben Clayton [Tue, 5 Mar 2019 17:17:59 +0000 (17:17 +0000)]
Reactor: Fix createFCmpUNE (LLVM)

This was just calling the wrong function.
Looks like a copy and paste bug.

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

5 years agoReactor: Add address-of operator on reference types.
Ben Clayton [Wed, 27 Feb 2019 13:51:22 +0000 (13:51 +0000)]
Reactor: Add address-of operator on reference types.

Allows expressions like:

Array<Float4> arr;
Pointer<Float4> ptr = &arr[0];

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

5 years agoVKPipeline: Log any errors produced by the SPIR-V optimizer
Ben Clayton [Tue, 5 Mar 2019 13:20:40 +0000 (13:20 +0000)]
VKPipeline: Log any errors produced by the SPIR-V optimizer

Some dEQP tests were not made for SPV_ENV_VULKAN_1_1, and error in the optimizer.
This produces 0 words of SPIR-V, that then goes and explodes in SpirvShader.

Add an assert to catch the 0-word case.

Bug: b/127454276
Change-Id: I60576e6691a9cf74656dfcd9c53aeed7ab578de1
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26188
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoFix windows build
Ben Clayton [Wed, 6 Mar 2019 21:01:52 +0000 (21:01 +0000)]
Fix windows build

MSVC does not like: sizeof(T[N])

Change-Id: If7586a0d29f609372e036fdb31481e923469a7ad
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26349
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoWire up depth and stencil attachments to pipeline
Chris Forbes [Sat, 2 Mar 2019 22:57:20 +0000 (14:57 -0800)]
Wire up depth and stencil attachments to pipeline

- Fix broken use of VkImageCreateFlags in various places as an aspect mask
- Be consistent about layout of D+S images. Layout is now [aspect][layer][level].
- Allow fetching an offset into a particular aspect.

Fixes dEQP-VK.pipeline.depth.*

Bug: b/118619338
Change-Id: I46adc9c637882e7144945eaeacce9f087d53caf0
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26011
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 agoSplit regres test lists into full and CI lists.
Ben Clayton [Wed, 6 Mar 2019 18:03:23 +0000 (18:03 +0000)]
Split regres test lists into full and CI lists.

tests/regres/full-tests.json contains a full test list that will be run
once every day. The results of this full test pass will update the
test lists binned by status (*-PASS.txt, *-FAIL.txt, etc).

tests/regres/ci-tests.json references just the *.PASS.txt lists, and
will be run for every change up for review.

The goal of this refactor is to significantly speed up the regres test
cycles. The side effect of this is that regres will no longer
automatically tell you when a single change passes new tests. It will
however tell you when you break tests. The daily test will show you new
tests that are passing, and gives a simple way to see all tests by
status.

Bug: b/127664487
Change-Id: I590378e0bf819211dbc4de85f63ce77a681f6e46
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26328
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoSpirvShader: Implement OpSelect
Ben Clayton [Tue, 5 Mar 2019 12:57:39 +0000 (12:57 +0000)]
SpirvShader: Implement OpSelect

Bug: b/126873455
Change-Id: I5df5206cb3743dd7b36d4ad521f9e9ddf81ae638
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26168
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Tested-by: Ben Clayton <bclayton@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 agoSpirvShader: Add relational ops for ordered and unordered floats
Ben Clayton [Mon, 4 Mar 2019 19:33:27 +0000 (19:33 +0000)]
SpirvShader: Add relational ops for ordered and unordered floats

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

5 years agoPlumb PipelineLayouts down to SpirvRoutine
Ben Clayton [Tue, 26 Feb 2019 15:02:18 +0000 (15:02 +0000)]
Plumb PipelineLayouts down to SpirvRoutine

This initializes arrays to hold the descriptor sets in the routine. Nothing uses this yet.

Bug: b/126330097
Change-Id: If052d0b93e62e4f32e88ed02f9bc21f4203587f5
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25553
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoImplement GetPhysicalDeviceSparseImageFormatProperties
Chris Forbes [Tue, 5 Mar 2019 22:47:16 +0000 (14:47 -0800)]
Implement GetPhysicalDeviceSparseImageFormatProperties

We don't support any sparse features, so we can always just produce zero
properties structures here. The VK1.1/GPDP2 equivalent already forwards
to this function, so we also get that for free.

Bug: b/118429780
Change-Id: I7b43a291354f1ca2ae01d021dfa48263b08b57cc
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26308
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoDisable creation of multisample images until they work
Chris Forbes [Wed, 6 Mar 2019 17:17:09 +0000 (09:17 -0800)]
Disable creation of multisample images until they work

Change-Id: I39608947651b855c6e2668de98ab5696e18f501f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26310
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoKokoro: Don't use verbose logging for make
Ben Clayton [Sat, 2 Mar 2019 01:22:52 +0000 (01:22 +0000)]
Kokoro: Don't use verbose logging for make

When the build fails, it's very hard to find the compiler error in the spam.

Change-Id: Ic975f0a075e4104db82a58ef03e1ba643e520fe2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26031
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAssert on unimplemented instructions
Chris Forbes [Mon, 4 Mar 2019 18:53:07 +0000 (10:53 -0800)]
Assert on unimplemented instructions

Replace the runtime `warning` with something that will actually crash
us, and add stub implementations of OpLabel and OpReturn to allow
trivial shaders to work.

There's little point in continuing beyond an unimplemented instruction
-- if you get lucky, you hit a crash on use of the instruction's result.
If you get unlucky, you wander off into undefined behavior.

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

5 years agoSpirvShader: Add relational ops for integers
Ben Clayton [Mon, 4 Mar 2019 16:32:09 +0000 (16:32 +0000)]
SpirvShader: Add relational ops for integers

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

5 years agoAdd -Wno-implicit-fallthrough
Logan Chien [Tue, 26 Feb 2019 05:49:53 +0000 (13:49 +0800)]
Add -Wno-implicit-fallthrough

This commit adds `-Wno-implicit-fallthrough` to disable implicit
fallthrough warnings.  This commit is required because the latest
LLVM/Clang toolchain emits more warnings.  Since `third_party/llvm-7.0`
is an upstream project, we don't want to locally patch the code.  Thus,
we are disabling implicit fallthrough warnings before it has been fixed
in the upstream.

Bug: b/115344057
Test: Build libGLESv2_swiftshader for Android
Change-Id: Ibde53e030ba66af20ba5281b33a684350ef4b35f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25529
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Logan Chien <loganchien@google.com>
5 years agoFix setup code to deal with inverted area sign
Chris Forbes [Mon, 4 Mar 2019 22:11:49 +0000 (14:11 -0800)]
Fix setup code to deal with inverted area sign

`d` is used to drive some indexing math later.

Bug: b/127343247
Change-Id: Id9da208f5a7b678748f129f97de03f5bf04bcbe1
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26128
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoImplement vkGetSwapchainImagesKHR
Hernan Liatis [Tue, 26 Feb 2019 19:19:27 +0000 (11:19 -0800)]
Implement vkGetSwapchainImagesKHR

dEQP tests passing:
dEQP-VK.wsi.xlib.swapchain.get_images

Bug: b/124265819
Change-Id: I4e2dc8dd48b93bbddba44654c72afb8f43bc3561
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25789
Tested-by: Hernan Liatis <hliatis@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoCreate CI for gcp_windows
Raymond Chiu [Thu, 21 Feb 2019 22:19:57 +0000 (14:19 -0800)]
Create CI for gcp_windows

Change-Id: I30738f487bfc1ac57ae3ef6265c013bb2865417f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25210
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Raymond Chiu <chiur@google.com>
5 years agoRemove some GL/D3D legacy format quirks from vulkan vertex buffers
Chris Forbes [Wed, 27 Feb 2019 21:48:24 +0000 (13:48 -0800)]
Remove some GL/D3D legacy format quirks from vulkan vertex buffers

- Fix mapping of B8G8R8A8 -- this is the same as the old D3DCOLOR.
- Remove all the other stream types that don't match anything in Vulkan.
- Remove unused resource pointer in stream

There is still future cleanup work to do here -- we should be able to
do vertex fetch purely based on the VkFormat rather than mapping it onto
the GL model.

Change-Id: Ia100ec68e8930acd17b6cba35a27403b4ef8e883
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25768
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoVkCreateSwapchainKHR and VkDestroySwapchainKHR
Hernan Liatis [Tue, 26 Feb 2019 03:29:54 +0000 (19:29 -0800)]
VkCreateSwapchainKHR and VkDestroySwapchainKHR

Bare bones implementation of a creatable and
destroyable swapchain

Bug: b/124265819
Change-Id: Ie8277184863ab6b7204b6c8f6fc2b2f86ad787c9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25509
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
5 years agoAdd support for conversion instructions
Chris Forbes [Sat, 2 Mar 2019 01:13:57 +0000 (17:13 -0800)]
Add support for conversion instructions

- OpSConvert, OpUConvert, OpFConvert have no valid use, as we only have
  one value width (32 bits) and these instructions perform width
  conversions only.
- OpConvertFToU, OpConvertFToS, OpConvertUToF, OpConvertSToF implemented
- OpBitcast implemented. Note that the spec looks scary wrt pointer
  types in OpBitcast, but 2.16.1 Universal Validation Rules disallows
  this use in the Logical addressing model.

Bug: b/126952020
Change-Id: I6c1c95d5ad4e19177e40ead7713bf63ffe16c679
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26010
Tested-by: 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 OpDot
Chris Forbes [Fri, 1 Mar 2019 21:24:17 +0000 (13:24 -0800)]
Add support for OpDot

Bug: b/126873455
Change-Id: Ibe76dc02ab22903f1ad2d00685cd1855aaeb3338
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25968
Tested-by: 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 support for OpUMulExtended, OpSMulExtended
Chris Forbes [Fri, 1 Mar 2019 17:08:47 +0000 (09:08 -0800)]
Add support for OpUMulExtended, OpSMulExtended

- Make the existing LLVMReactor lowering support for MulHigh on non-x86
  available on x86 as well, as we don't have good intrinsics-based implementation
  of 4x 32bit mul highs. At some point in the future we can rework this
  to use some shuffles and a pair of pmuludq.
- Plumb through Int4 and UInt4 variants of MulHigh
- Implement SPIRV OpUMulExtended, OpSMulExtended in terms of MulHigh

Bug: b/126873455
Change-Id: I25ba0a69691e7a6f7a5542ec4a90a44ba8f68331
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25929
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
5 years agoSpirvShader: Add debug checks on Intermediate.
Ben Clayton [Thu, 28 Feb 2019 20:06:42 +0000 (20:06 +0000)]
SpirvShader: Add debug checks on Intermediate.

Memset the scalars to 0, and check their pointers before use. Catches cases where the intermediate was declared but not set.

Also switch from using assert() to ASSERT() as the latter still fires with DCHECK_ALWAYS_ON.

Change-Id: I81abb50aea41568f95c22a340b90b7c56839d3ce
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/25869
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoregres: fix wsi test list
Chris Forbes [Mon, 4 Mar 2019 16:47:51 +0000 (08:47 -0800)]
regres: fix wsi test list

Previously we had generated this via deqp-vk --deqp-runmode=stdout-caselist
+ a sed one-liner to strip off the prefix. Unfortunately, that's not quite
good enough -- that output contains a `GROUP: ` line for every non-leaf in
the the test tree. deqp would then produce log spam when failing to find
those nonexistent tests.

New test list generated by also filtering those `GROUP: ` lines.

Change-Id: If3c97724988f94e2e127e9e091960e1f51e3599a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26068
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoFix culling to match Vulkan convention
Chris Forbes [Fri, 1 Mar 2019 23:10:25 +0000 (15:10 -0800)]
Fix culling to match Vulkan convention

Correct the sign of the area calculation. The front facing determination
can then be written to exactly match the spec -- CCW means positive area
is front facing.

Change-Id: Ibed3e26b0cf77030325044c7dc9e818264a8750d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26009
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAllow all vkBeginCommandBuffer flags
Chris Forbes [Sat, 2 Mar 2019 01:40:25 +0000 (17:40 -0800)]
Allow all vkBeginCommandBuffer flags

Our command buffer playback mechanism is safe for multiple inflight
submissions of the same command buffer, so there is nothing special to
do here.

The problematic case of needing to carry some state from a primary
command buffer into a secondary is already caught by the slightly later
check for pInheritanceInfo.

Bug: b/118619338
Change-Id: I782285fbc9127d59eeac7cbf79fea3f1952e3cde
Reviewed-on: https://swiftshader-review.googlesource.com/c/25950
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Hernan Liatis <hliatis@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoWindows build fix
Alexis Hetu [Fri, 1 Mar 2019 20:31:31 +0000 (15:31 -0500)]
Windows build fix

Bug swiftshader:124

Change-Id: Ied13e859cc8984e59af393de6ca1a93428a0e30e
Reviewed-on: https://swiftshader-review.googlesource.com/c/25949
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>