OSDN Git Service

android-x86/external-swiftshader.git
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>
5 years agoEnsure image strides are always suitable for the rasterizer
Chris Forbes [Thu, 21 Mar 2019 18:23:28 +0000 (11:23 -0700)]
Ensure image strides are always suitable for the rasterizer

Bug: b/129069789
Test: dEQP-VK.glsl.derivate.*
Change-Id: Iac1b5ed51dae0f6d8937b2162eb0a662d02b34ba
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27729
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 agovkCmdExecuteCommands implementation
Alexis Hetu [Mon, 18 Mar 2019 20:16:36 +0000 (16:16 -0400)]
vkCmdExecuteCommands implementation

Basic support for executing secondary command buffers, without
support for any inheritance features.

Bug b/118619338

Change-Id: Ie3453018a45a722ecfa4f1acd20c95442fbb3d9b
Tests: dEQP-VK.memory.pipeline_barrier.host_write_transfer_src.*
Tests: dEQP-VK.api.command_buffers.allocate_single_secondary
Tests: dEQP-VK.api.command_buffers.allocate_many_secondary
Tests: dEQP-VK.api.command_buffers.trim_command_pool_secondary
Tests: dEQP-VK.api.command_buffers.record_single_secondary
Tests: dEQP-VK.api.command_buffers.record_many_secondary
Tests: dEQP-VK.api.command_buffers.submit_twice_secondary
Tests: dEQP-VK.api.command_buffers.record_one_time_submit_secondary
Tests: dEQP-VK.api.command_buffers.secondary_execute
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27493
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoFix provoking vertex convention and remove configurability
Chris Forbes [Mon, 18 Mar 2019 22:01:48 +0000 (15:01 -0700)]
Fix provoking vertex convention and remove configurability

- secondaryColor control only made sense in fixed-function
- Vulkan provoking vertex is always the first vertex

Bug: b/125909515
Test: dEQP-VK.rasterization.flatshading.*
Change-Id: I9b6826e093076ee7ca5ef6deaf1b1fbd1c2f39e3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27509
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoSynchronize at end of renderpass
Chris Forbes [Thu, 21 Mar 2019 15:36:11 +0000 (08:36 -0700)]
Synchronize at end of renderpass

Heavy-handed implementation of implicit or explicit VkSubpassDependency
to VK_SUBPASS_EXTERNAL after a subpass.

Fixes various test flake.

Test: dEQP-VK.glsl.derivate.*
Change-Id: I9cb60828e6aff344e28dd7a8e1a867b5c8a11c22
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27708
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 agosw::Surface removed
Alexis Hetu [Mon, 18 Mar 2019 18:24:38 +0000 (14:24 -0400)]
sw::Surface removed

There are no more dependencies on sw::Surface, it can now be removed.

Bug b/126883332

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

5 years agosw::Surface references removed from sampling code
Alexis Hetu [Mon, 18 Mar 2019 15:30:01 +0000 (11:30 -0400)]
sw::Surface references removed from sampling code

vk::Format was expanded to include more format related checks and the
sampler object now uses them. Whether or not the Sampler code ends up
actually being used is unsure, but the code has been updated to use
vk::Image instead of sw::Surface. This should be the last sw::Surface
reference in Vulkan code.

Bug b/126883332

Change-Id: Ib1b4c3ce87d0fdad5ac7238b7e86211a499871a5
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27490
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 agoBasic CommandBuffer::waitEvents implementation
Alexis Hetu [Fri, 15 Mar 2019 18:45:45 +0000 (14:45 -0400)]
Basic CommandBuffer::waitEvents implementation

Implemented waitEvents as a sync operation, like pipeline barriers,
since, as the Vulkan spec states:
"vkCmdWaitEvents is used with vkCmdSetEvent to define a memory
 dependency between two sets of action commands, roughly in the
 same way as pipeline barriers, but split into two commands such
 that work between the two may execute unhindered."

Only the pEvents parameter is supported and currently doesn't support
pMemoryBarrier, pBufferMemoryBarriers or pImageMemoryBarriers.

Bug b/118620868

Change-Id: I30ccc65c65dfc7d9a99e25ebb535061c618375cb
Tests: dEQP-VK.api.command_buffers.record_simul_use_primary
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27348
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@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 agoRefactor variable type lookup
Nicolas Capens [Tue, 19 Mar 2019 20:22:35 +0000 (16:22 -0400)]
Refactor variable type lookup

Previously the pointee type of OpVariable was determined starting from
the result ID. It just obtains the 'Object' which has the type collected
from the OpVariable instruction itself. So the object lookup can be
skipped by using the latter directly again.

Bug b/129000021

Change-Id: I882d837c4cc1c7a8d0b19de38dc8ee19e622af33
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27651
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 agoRegres: Update test lists @ aff2dd06
SwiftShader Regression Bot [Thu, 21 Mar 2019 05:52:15 +0000 (05:52 +0000)]
Regres: Update test lists @ aff2dd06

Change-Id: I250bf1da0e6f1556af67f320b7cafabc4724f34f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27572
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoAdd support for derivative instructions
Chris Forbes [Wed, 20 Mar 2019 21:50:24 +0000 (14:50 -0700)]
Add support for derivative instructions

- OpDPdx
- OpDPdy
- OpFwidth
- OpDPdxCoarse
- OpDPdyCoarse
- OpFwidthCoarse
- OpDPdxFine
- OpDPdyFine
- OpFwidthFine

We have flexibility in how we implement the OpDPdx, OpDPdy and OpFwidth
instructions; they can return either coarse or fine derivatives.
I have chosen to make them equivalent to the coarse derivatives since
those are slightly cheaper to compute.

Added a static assert to ensure we revisit these when considering other
vector widths.

Bug: b/129002115
Test: dEQP-VK.glsl.derivate.*
Change-Id: I75224c1e77c1eefac4f219be5662836daa86a098
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27689
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 agoVulkan: Plumb bound descriptor sets down to SpirvRoutine.
Chris Forbes [Tue, 19 Mar 2019 23:48:03 +0000 (16:48 -0700)]
Vulkan: Plumb bound descriptor sets down to SpirvRoutine.

Choice of tests is slightly odd -- but there are a number of tests in
this group which *don't* use the derivative instructions (glslang is
smart enough to not emit them when the expression is known to be uniform).

Bug: b/126330097
Test: dEQP-VK.glsl.derivate.*
Test: dEQP-VK.ubo.*
Change-Id: I8864149104f2ea9b62c75ceae59da4ff8adebc32
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26548
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 agoFix MSVC build
Nicolas Capens [Wed, 20 Mar 2019 19:15:46 +0000 (15:15 -0400)]
Fix MSVC build

Was wrongly assuming that if ..\deqp exists, the build directory must
be deqp\build.

Change-Id: I0e071565d9c41940efbcd4453de70f2994ad1be5
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27652
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoFactor out vertex attribute binding from Draw*::play
Chris Forbes [Sat, 9 Mar 2019 01:10:41 +0000 (17:10 -0800)]
Factor out vertex attribute binding from Draw*::play

I'm about to build some more on top of this; don't want to write it
multiple times.

Change-Id: I9ca84536f47b886e9f03edcaa6dc5dfe6e34091d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26688
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: 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 agoDon't treat SIMD::Float preferentially
Nicolas Capens [Tue, 19 Mar 2019 18:28:18 +0000 (14:28 -0400)]
Don't treat SIMD::Float preferentially

Intermediate::Scalar was defined as RValue<SIMD::Float>, even though it
can hold integers as well. Use abstract Reactor values instead which
don't have a statically defined type.

This change does not yet avoid bitcasting on access. The EmitLoad()
implementation still assumes values come in as float.

Bug b/128539387

Change-Id: I18f449ebf68db7ddd81679d6d028911e6c02fc38
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26868
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoRegres: Update test lists @ f2564656
SwiftShader Regression Bot [Wed, 20 Mar 2019 07:56:55 +0000 (07:56 +0000)]
Regres: Update test lists @ f2564656

Change-Id: Ibfb2c1126253d98d15016b464e79e06f4d1bac8a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27570
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoWire up BuiltInWorkgroupId to compute pipeline
Chris Forbes [Tue, 19 Mar 2019 16:06:19 +0000 (09:06 -0700)]
Wire up BuiltInWorkgroupId to compute pipeline

Previously this was left uninitialized, with exciting results
when a shader used it for buffer indexing etc.

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

5 years agoCarry decorations down type tree in WalkExplicitLayoutAccessChain
Chris Forbes [Tue, 19 Mar 2019 16:06:19 +0000 (09:06 -0700)]
Carry decorations down type tree in WalkExplicitLayoutAccessChain

Bug: b/128690261
Bug: b/128872954
Test: dEQP-VK.*push_constant*
Test: dEQP-VK.glsl.*
Test: dEQP-VK.spirv_assembly.*
Change-Id: I0f8d103288777cd03347b32366ed5c5606e38b8d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27588
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 push constants
Chris Forbes [Tue, 19 Mar 2019 01:51:55 +0000 (18:51 -0700)]
Add support for push constants

- Proper support for calculating offsets in explicit-layout storage
classes (push constant, uniform, and storage buffer) according to the
Offset, ArrayStride and MatrixStride decorations.
- Plumb a block of push constant data throughout the pipeline
- Implement push constant update commands

Bug: b/128690261
Bug: b/128872954
Test: dEQP-VK.*push_constant*
Test: dEQP-VK.glsl.*
Test: dEQP-VK.spirv_assembly.*
Change-Id: I7d5a66ac4aafd6b637b4693eb6ce96a327b4904e
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27528
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 agoFix VulkanUnitTests on Visual Studio
Nicolas Capens [Tue, 19 Mar 2019 17:55:25 +0000 (13:55 -0400)]
Fix VulkanUnitTests on Visual Studio

Also copy the DLLs to build/
This makes it consistent with the CMake build.

Bug b/116336664
Bug b/29024574

Change-Id: I747a52383492c3ec5493f1a232cbbf5c98aec219
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27608
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoAdd support for OpUndef
Chris Forbes [Tue, 19 Mar 2019 02:31:16 +0000 (19:31 -0700)]
Add support for OpUndef

Treat OpUndef identically to OpConstantNull for now.

Change-Id: I721f2bf5e053d6a8d6f563272b1d44b6636a157c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27529
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Categorize crashes caused by debug macros
Ben Clayton [Mon, 18 Mar 2019 15:13:48 +0000 (15:13 +0000)]
Regres: Categorize crashes caused by debug macros

List most common failures on the daily report.

Change-Id: Ia07f73601727f71e5f2abee7c40886e2a05209bb
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27472
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoRegres: Fix priority boost for +2 code review.
Ben Clayton [Thu, 14 Mar 2019 10:08:17 +0000 (10:08 +0000)]
Regres: Fix priority boost for +2 code review.

Confusingly the "Code-Review" label uses 'Value' for -1 / +1, and 'Approved' for +2s.

Changes that were ready to land were not being prioritized over no-code review.

Change-Id: Ia31adcbbba70b2f52b9abc7299f4bafdcdb8fe48
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27170
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoRegres: Don't attempt to build failing changes forever.
Ben Clayton [Thu, 14 Mar 2019 09:51:36 +0000 (09:51 +0000)]
Regres: Don't attempt to build failing changes forever.

If a test failed to build, an error was logged to stdout, but the error was not posted to the change. This meant the change would be picked up by regres again, and the process would repeat ad-infinitum.

Posting of the build error used to work, but was broken by bfaf4e825b.

Change-Id: I1e59f0d2e5ee26eb002aa2c596dc5491e48a9c87
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27169
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoFix mipmap generation on undefined cube texture
Nicolas Capens [Mon, 18 Mar 2019 16:42:22 +0000 (12:42 -0400)]
Fix mipmap generation on undefined cube texture

Cube textures must be cube complete to generate mipmaps, but when the
base level is undefined the glGenerateMipmap command must be silently
ignored. This was previously leading to a null dereference.

Bug chromium:924022
Bug https://gitlab.khronos.org/opengl/API/issues/72

Change-Id: I5d6e8533118e554efa12045fc376126c7b00f263
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27491
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoUse C++11 std::swap()
Nicolas Capens [Tue, 19 Mar 2019 05:52:40 +0000 (01:52 -0400)]
Use C++11 std::swap()

Bug b/126126820

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

5 years agoRegres: Update test lists @ bbf5cf1e
SwiftShader Regression Bot [Tue, 19 Mar 2019 09:12:30 +0000 (09:12 +0000)]
Regres: Update test lists @ bbf5cf1e

Change-Id: I5aab5f50bad232227a7bf3af1dd40396c0f208a5
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27449
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoWire up sample mask correctly
Chris Forbes [Wed, 6 Mar 2019 17:00:56 +0000 (09:00 -0800)]
Wire up sample mask correctly

Bug: b/118386749
Change-Id: I4d6150907a0afea8eeff28334dae1e4af6309075
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26309
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 agoTidy stencil state handling
Chris Forbes [Mon, 18 Mar 2019 18:41:56 +0000 (11:41 -0700)]
Tidy stencil state handling

Bug: b/128715612
Change-Id: I1e9859d2cf001bfb341a49ad4f8fc9ef52c9fa5b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27508
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 agoAllow null dispatchable objects
Alexis Hetu [Fri, 15 Mar 2019 19:56:01 +0000 (15:56 -0400)]
Allow null dispatchable objects

Because we need to dereference dispatchable objects in order to get
the underlying object, we need to first check for VK_NULL_HANDLE to
avoid crashing.

Bug b/116336664

Change-Id: Ia903dcc6142d5e7f283da8fbef0f43bae3ca243f
Tests: dEQP-VK.api.null_handle.free_command_buffers
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27388
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

5 years agoCopy kokoro folder to tests/kokoro
Nicolas Capens [Mon, 18 Mar 2019 14:03:43 +0000 (10:03 -0400)]
Copy kokoro folder to tests/kokoro

This duplicates the folder for now. The old one will be removed once
the service has been switched over to the new one.

Bug b/126742833

Change-Id: Idba255cb8dad165559c56cb614fa915089c3858d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27489
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoFix Travis CI build
Nicolas Capens [Mon, 18 Mar 2019 13:54:20 +0000 (09:54 -0400)]
Fix Travis CI build

The /build directory is checked into the repository so the
'mkdir build' produced an error that it already exists.

We'll switch to using Kokoro for CI as soon as it completely replaces
all uses of Travis CI.

Bug b/115784742

Change-Id: Ie04edccbb7a875f105353eec203fcabce2f33bc3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27488
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
5 years agoReintroduce "VkDebug: Update macros to address issues in b/127433389"
Ben Clayton [Sun, 17 Mar 2019 17:29:30 +0000 (17:29 +0000)]
Reintroduce "VkDebug: Update macros to address issues in b/127433389"

36411219f had preprocessor issues on Windows.
This should now work on all platforms.

I had to change UNIMPLEMENTED() and UNREACHABLE() to always take a
format parameter to make this work on MSVC. This doesn't seem like
a terrible thing though - especially if we can incorporate the
frequency of hit UNIMPLEMENTED()'s to steer our focus.

Change-Id: Idc58dbe6caa3fb51e085c3b236904c640091deec
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27468
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 agoComputeProgram: Clean up usage of Float4/Int4 and SIMD::Float/SIMD::Int
Ben Clayton [Wed, 13 Mar 2019 14:28:32 +0000 (14:28 +0000)]
ComputeProgram: Clean up usage of Float4/Int4 and SIMD::Float/SIMD::Int

Bug: b/126126820
Change-Id: I0df0841952dcaa9c8376847704a9697b9c9e9894
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27093
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>
5 years agoCompute: WorkgroupSize decorations take precedence over LocalSize
Ben Clayton [Wed, 13 Mar 2019 14:18:58 +0000 (14:18 +0000)]
Compute: WorkgroupSize decorations take precedence over LocalSize

Test: dEQP-VK.subgroups.builtin_var.compute.*
Bug: b/126871859
Change-Id: Ida9cb49548ec984039d8730d50be7c8b22c3bfb8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27092
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
5 years agoRegres: Update test lists @ 845cb5e1
SwiftShader Regression Bot [Sat, 16 Mar 2019 06:06:11 +0000 (06:06 +0000)]
Regres: Update test lists @ 845cb5e1

Change-Id: Idbe4177c0031c858b0886c8c3c8ebe8e92d2614b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27448
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoFix stencil state plumbing
Chris Forbes [Sat, 16 Mar 2019 02:31:21 +0000 (19:31 -0700)]
Fix stencil state plumbing

Bug: b/128715612
Test: dEQP-VK.pipeline.stencil.format.*
Change-Id: I4789c0ff77c43e91fc7cbd7e2aceab0b1ba9cdb3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27429
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 agoPropagate image view clear aspect mask to image clear
Chris Forbes [Sat, 16 Mar 2019 01:37:58 +0000 (18:37 -0700)]
Propagate image view clear aspect mask to image clear

The mask was previously dropped on the floor here, and the imageview's
only mask used instead. This would produce incorrect results when a
renderpass begin operation had different load ops for depth vs stencil aspect.

Bug: b/128715612
Change-Id: I2bf4051e16c027737b65cd5bc5193a94cf891c36
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27428
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 OpFRem
Chris Forbes [Fri, 15 Mar 2019 21:50:47 +0000 (14:50 -0700)]
Add support for OpFRem

This is the `other` remainder from OpFMod, which we already had.
Uses the existing RValue<Float4> % RValue<Float4> operator wiring; the
only plumbing I had to fix was that llvm emits a call to fmodf, which
was made available in ExternalFunctionSymbolResolver.

Test: dEQP-VK.spirv_assembly.instruction.compute.opfrem.all
Test: dEQP-VK.spirv_assembly.instruction.graphics.frem.*
Bug: b/126873455
Change-Id: I81fbfd8f9e5cab6ac2f16319edda031a122e3a4d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27370
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 OpFMod
Chris Forbes [Fri, 15 Mar 2019 20:43:36 +0000 (13:43 -0700)]
Add support for OpFMod

Bug: b/126873455
Test: dEQP-VK.glsl.operator.common_functions.mod.*
Change-Id: I7f261e7bd4dda72b18594cd7e2ee7044bc60466b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27369
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 OpInBoundsAccessChain
Chris Forbes [Fri, 15 Mar 2019 19:27:34 +0000 (12:27 -0700)]
Add support for OpInBoundsAccessChain

This can be treated exactly the same as OpAccessChain.

Bug: b/128690261
Bug: b/127950082
Test: dEQP-VK.spirv_assembly.instruction.compute.opinboundsaccesschain.*
Change-Id: I65312ad48e461ec83e6999c6a899820e91e2a68b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27368
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 agoRemove Reactor argument tests for small integers
Nicolas Capens [Fri, 15 Mar 2019 21:22:42 +0000 (17:22 -0400)]
Remove Reactor argument tests for small integers

Booleans and integer types smaller than 32-bit are not readily
supported as arguments by Subzero.

Was broken by https://swiftshader-review.googlesource.com/27251

Change-Id: I0803037100b107ca9f7b627c2effd0493b8ab1a8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27390
Tested-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
5 years agoRevert "VkDebug: Update macros to address issues in b/127433389"
Ben Clayton [Fri, 15 Mar 2019 20:41:33 +0000 (20:41 +0000)]
Revert "VkDebug: Update macros to address issues in b/127433389"

Breaks windows build.

This reverts commit 36411219ff2b1c1c3a783b6577b812e0bc5f2293.

Change-Id: I89286d25ed0e362f16e981d3c4d39a4661ee02c2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27329
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 agoAdd Python path to Kokoro batch script
Nicolas Capens [Fri, 15 Mar 2019 20:18:29 +0000 (16:18 -0400)]
Add Python path to Kokoro batch script

Bug b/123360006

Change-Id: Ie29b1fea3607ad0da2fb48cf3a5248e976c2cf5f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27389
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
5 years agoAdd support for OpVectorInsertDynamic, OpVectorExtractDynamic
Chris Forbes [Fri, 15 Mar 2019 17:31:08 +0000 (10:31 -0700)]
Add support for OpVectorInsertDynamic, OpVectorExtractDynamic

Bug: b/126873455
Tests: dEQP-VK.spirv_assembly.*
Change-Id: I8b6b6329b37469b9779178488f96fc62c341997b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27308
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 OpSRem
Chris Forbes [Thu, 14 Mar 2019 19:55:20 +0000 (12:55 -0700)]
Add support for OpSRem

Test: dEQP-VK.spirv_assembly.*srem*
Bug: b/126873455
Change-Id: I9f5f519f7dac72ef7c7b45e88451fcb9dae0b3f8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27270
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 agoRemove asserts on depth bounds values
Chris Forbes [Thu, 14 Mar 2019 20:07:37 +0000 (13:07 -0700)]
Remove asserts on depth bounds values

We don't support the depth bounds test so these values do nothing; there
is no validity requirement placed on these values

Bug: b/118386749

Change-Id: I6e75181df6c2b497e91e2fa7a2029d408f8bacbe
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27269
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 agoRemove asserts blocking specialization constant use
Chris Forbes [Thu, 14 Mar 2019 20:07:08 +0000 (13:07 -0700)]
Remove asserts blocking specialization constant use

These have been fully implemented for some time.

Bug: b/124058197
Change-Id: I8146c0902aa0c4caa974e5af5b1a36104846934c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27268
Reviewed-by: Alexis Hétu <sugoi@google.com>
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 agoRun spirv-opt pass to eliminate dead functions after inlining
Chris Forbes [Thu, 14 Mar 2019 21:19:04 +0000 (14:19 -0700)]
Run spirv-opt pass to eliminate dead functions after inlining

The inliner leaves the original functions. If we want the simplicity of
not thinking about functions, we have to remove them.

Change-Id: I0d0c7f8d3de21095b52d86a4c62015287eda32cc
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27272
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 agoComputeProgram: Add subgroup builtins.
Ben Clayton [Wed, 13 Mar 2019 09:16:50 +0000 (09:16 +0000)]
ComputeProgram: Add subgroup builtins.

Test: dEQP-VK.subgroups.builtin_var.compute.*

Bug: b/126871859
Change-Id: If1585778ca5a85e2b8a66f4ddf6a58050620a112
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27089
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
5 years agoDescriptorSetLayout destruction fix
Alexis Hetu [Fri, 15 Mar 2019 15:41:04 +0000 (11:41 -0400)]
DescriptorSetLayout destruction fix

Extra useless deallocations weren't cleaned up properly.
Removed them.

Bug b/123244275

Change-Id: I418a4c09a870748551a92c1abb3986e94b32ba92
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27289
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 agosRGB filtering fix
Alexis Hetu [Fri, 15 Mar 2019 12:32:49 +0000 (08:32 -0400)]
sRGB filtering fix

Enable sRGB conversion when filtering sRGB images

Tests: dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.generate_mipmaps.*

Bug b/119620767

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

5 years agoCubeMap fixes
Alexis Hetu [Thu, 14 Mar 2019 19:10:51 +0000 (15:10 -0400)]
CubeMap fixes

The following changes are done in this cl:
- Added multilayer support in Blitter::blit()
- Fixed Image::texelOffsetBytesInStorage() for cubes, since there's
  a 1 pixel border around it, so pixel offset (0,0,0) should be an
  extra line (1 pixel offset in Y) + 1 pixel (1 pixel offset in X)
  from the beginning of the buffer
- Added a number of out of bounds memory access asserts, which
  helped debug this issue.

Fixed failures in:
dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.generate_mipmaps.*
Note: The only failures left in that category are related to filtering
sRGB images, which most likely happens in the wrong colorspace.

Tests: dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.generate_mipmaps.*

Bug b/119620767

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

5 years agoDedicated allocation verification
Alexis Hetu [Fri, 15 Mar 2019 16:12:00 +0000 (12:12 -0400)]
Dedicated allocation verification

Added the ability to set the VkMemoryDedicatedRequirements
structure in vkGetBufferMemoryRequirements2. Note that this
cl adds no support for dedicated allocations.

Passes all tests in the Tests section below.

Change-Id: Ib5bc2775e66e810d1ca2d52672eb2cca71e85f5e
Tests: dEQP-VK.api.buffer.dedicated_alloc.*
Tests: dEQP-VK.api.buffer_view.create.*
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27290
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>